What every developer should know about the browser console and network tab
Every modern browser ships with a built-in set of developer tools, and two of the most useful are the Console and the Network tab. Together they let you see what your code is doing, what data is moving between the browser and the server, and where things are going wrong. Yet many developers only scratch the surface of what these tools can do. Understanding them well is one of the fastest ways to become a more effective frontend or full-stack developer.
Browser developer tools
Developer tools are usually opened with F12, or Ctrl+Shift+I on Windows and Cmd+Option+I on macOS. Once open, you will see several tabs, each focused on a different aspect of the page:
- Elements - inspect and edit the live HTML and CSS of the page.
- Console - view logs, errors, and warnings, and run JavaScript.
- Sources - browse and debug the JavaScript files the page loaded.
- Network - watch every request the page makes and the responses it receives.
- Performance, Memory, and Application - profile runtime behavior and inspect storage.
For day-to-day debugging, the Console and Network tabs do most of the heavy lifting.
The browser console
The console is a live window into your JavaScript. It surfaces problems as they happen and lets you interact with the page directly. Anything your code logs, any error it throws, and any warning the browser raises shows up here.
JavaScript errors
When code fails, the console shows the error message along with the file name and line number, plus a stack trace you can expand to follow the call path. This is usually the first place to look when a feature stops working.
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
at renderProfile (profile.js:42)
at app.js:17Custom logs
You can write your own messages to the console to trace how code runs. Beyond console.log, the console offers leveled methods that are styled differently and can be filtered.
console.log('User loaded:', user);
console.info('Fetching dashboard data...');
console.warn('Falling back to cached results');
console.error('Payment request failed', error);
// Group related logs together
console.group('Checkout');
console.log('items', cart.items);
console.log('total', cart.total);
console.groupEnd();
// Print tabular data as a table
console.table(users);Inspecting API responses
Logging the data returned from an API is one of the quickest ways to confirm your frontend is receiving what you expect. Objects and arrays are rendered as expandable trees you can drill into.
fetch('/api/users')
.then((res) => res.json())
.then((data) => console.log('users', data))
.catch((err) => console.error('request failed', err));Executing JavaScript on the fly
The console is also a REPL. You can run any JavaScript against the current page - read variables, call functions, or manipulate the DOM - without changing your source files. This makes it ideal for quick experiments and live debugging.
The network tab
If the console tells you what your JavaScript is doing, the Network tab tells you what is happening between the browser and the server. Every request - HTML, CSS, scripts, images, and API calls - appears here with full details about how it was sent and what came back.
Information available for each request
Selecting a request reveals everything you need to understand it:
- Request URL - the exact endpoint that was called.
- HTTP method - GET, POST, PUT, DELETE, and so on.
- Status code - whether the request succeeded, redirected, or failed.
- Request headers - what the browser sent, including auth tokens and content type.
- Response headers - what the server sent back, including caching and CORS info.
- Request payload - the body sent with POST and PUT requests.
- Response body - the actual data returned, often JSON.
- Timing - how long each phase of the request took.
Reading status codes
Status codes are the fastest way to triage a failing request. Knowing the broad categories tells you immediately whether the problem is on the client or the server.
| Code | Meaning | What it usually tells you |
|---|---|---|
| 200 | OK | The request succeeded. |
| 201 | Created | A resource was created successfully (often after a POST). |
| 301 / 302 | Redirect | The resource moved; the browser followed a new URL. |
| 400 | Bad Request | The client sent something the server could not parse. |
| 401 | Unauthorized | Authentication is missing or invalid. |
| 403 | Forbidden | Authenticated, but not allowed to access the resource. |
| 404 | Not Found | The endpoint or resource does not exist. |
| 500 | Server Error | Something failed on the server side. |
Inspecting payloads and responses
For POST and PUT requests you can see exactly what the browser sent, which is invaluable when a server rejects a request as malformed. The Response tab shows the raw data the server returned.
{
"email": "user@example.com",
"plan": "pro",
"acceptedTerms": true
}Practical debugging examples
A few common scenarios show how the two tabs work together:
- A button does nothing - check the Console for a thrown error or a failed event handler.
- Data is missing on the page - check the Network tab to confirm the API returned it, then log the parsed response in the Console.
- A request returns 401 - inspect the request headers in the Network tab to verify the auth token was actually sent.
- The page is slow - use the timing breakdown in the Network tab to find requests that block rendering.
Console vs network: which to reach for
| Console | Network | |
|---|---|---|
| Primary focus | JavaScript execution and logging | HTTP requests and responses |
| Best for | Errors, custom logs, running code | API calls, status codes, payloads |
| Typical question | Why did my code break? | What did the server send back? |
| Key strength | Live interaction with the page | Full visibility into data transfer |
Best practices
- Use leveled logging (info, warn, error) so messages are easy to filter.
- Remove or guard noisy console logs before shipping to production.
- Filter the Network tab by type (XHR/Fetch) to focus on API calls.
- Use 'Preserve log' when debugging redirects or navigation so requests are not cleared.
- Read the status code first - it often tells you where the problem lives before you read anything else.
Conclusion
The console and network tab are not just for emergencies. Used routinely, they give you a clear picture of how your application behaves, how data flows through it, and where it breaks. Investing a little time to learn them deeply pays off in faster debugging, fewer guesses, and a much stronger understanding of how the web actually works.