All posts
Web Development · 7 min read · Apr 30, 2026

What every developer should know about the browser console and network tab

Browser developer tools 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.

text
Uncaught TypeError: Cannot read properties of undefined (reading 'name')
    at renderProfile (profile.js:42)
    at app.js:17
A typical console error pointing straight at the file and line that failed.

Custom 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.

javascript
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);
console offers far more than log - info, warn, error, group, and table are all useful.

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.

javascript
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.

CodeMeaningWhat it usually tells you
200OKThe request succeeded.
201CreatedA resource was created successfully (often after a POST).
301 / 302RedirectThe resource moved; the browser followed a new URL.
400Bad RequestThe client sent something the server could not parse.
401UnauthorizedAuthentication is missing or invalid.
403ForbiddenAuthenticated, but not allowed to access the resource.
404Not FoundThe endpoint or resource does not exist.
500Server ErrorSomething failed on the server side.
4xx codes point to the client; 5xx codes point to the server.

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.

json
{
  "email": "user@example.com",
  "plan": "pro",
  "acceptedTerms": true
}
A request payload visible under the Payload tab for a POST request.

Practical debugging examples

A few common scenarios show how the two tabs work together:

  1. A button does nothing - check the Console for a thrown error or a failed event handler.
  2. Data is missing on the page - check the Network tab to confirm the API returned it, then log the parsed response in the Console.
  3. A request returns 401 - inspect the request headers in the Network tab to verify the auth token was actually sent.
  4. 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

ConsoleNetwork
Primary focusJavaScript execution and loggingHTTP requests and responses
Best forErrors, custom logs, running codeAPI calls, status codes, payloads
Typical questionWhy did my code break?What did the server send back?
Key strengthLive interaction with the pageFull 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.

Contact

Let’s connect

Have a Liferay or Backend project you’d like to talk through? Fill in the form and I’ll get back to you.

Book Calendar