Browser DevTools Guide

Master Chrome and Firefox developer tools to debug, optimize, and build better websites. Your essential companion for web development.

What are DevTools?

Browser Developer Tools (DevTools) are built-in features that help you inspect, debug, and optimize websites. Available in all modern browsers, they're essential for any web developer.

How to Open DevTools

Windows/Linux: F12 or Ctrl+Shift+I Mac: Cmd+Option+I Right-click → Inspect

Elements Panel

Inspect and modify HTML and CSS in real-time. The most frequently used panel for debugging layouts and styling issues.

Key Features:

Inspect Element

Click the selector icon, then click any element on the page to view its HTML and CSS.

Edit HTML Live

Double-click any element to edit HTML directly. Changes apply instantly (not saved to file).

Modify CSS Styles

Add, edit, or disable CSS properties in the Styles pane. Test changes before updating your files.

Box Model Visualization

See margin, border, padding, and content dimensions with the interactive box model diagram.

Inspect Element Ctrl+Shift+C
Delete Node Delete
Edit as HTML F2

Console Panel

View JavaScript errors, warnings, and logs. Execute JavaScript commands directly and interact with page variables.

Key Features:

View Errors & Warnings

See all JavaScript errors, warnings, and console.log() output in real-time.

Execute JavaScript

Run any JavaScript code directly in the console. Access page variables, DOM, and functions.

Debug with console.log()

Use console.log(), console.error(), console.table() to track variables and execution flow.

Access Selected Element

Use $0 to reference the currently selected element in the Elements panel.

Open Console Ctrl+Shift+J
Clear Console Ctrl+L
Previous Command ↑ Arrow

Network Panel

Monitor all network requests, view response data, and analyze page load performance. Essential for debugging API calls and optimizing load times.

Key Features:

View All Requests

See every HTTP request: HTML, CSS, JS, images, API calls, and more with timing information.

Inspect Request/Response

Click any request to see headers, response body, cookies, and timing details.

Filter Requests

Filter by type (XHR, JS, CSS, Img), status code, or search for specific files.

Throttle Connection

Simulate slow 3G, 4G, or offline conditions to test performance on mobile networks.

Record Requests Ctrl+E
Clear Requests Ctrl+L
Search Ctrl+F

Sources/Debugger Panel

Debug JavaScript code with breakpoints, step through execution, and inspect variables at runtime. The most powerful debugging tool.

Key Features:

Set Breakpoints

Click line numbers to pause execution at that point. Inspect variables and call stack.

Step Through Code

Use step over, step into, and step out controls to execute code line by line.

Watch Expressions

Monitor specific variables or expressions as you step through code execution.

Call Stack

See the sequence of function calls that led to the current breakpoint.

Toggle Breakpoint Ctrl+B
Step Over F10
Step Into F11
Step Out Shift+F11
Continue F8

Performance Panel

Record and analyze runtime performance. Identify slow functions, excessive reflows, and optimize your application's speed.

Key Features:

Record Performance

Record page activity to see CPU usage, function calls, and rendering performance over time.

Identify Bottlenecks

Find slow JavaScript functions, long tasks, and performance issues causing lag.

Frame Rate Analysis

Monitor FPS (frames per second) to ensure smooth animations and scrolling.

Memory Profiling

Track memory usage and detect memory leaks in your application.

Application/Storage Panel

Inspect and manage storage: cookies, localStorage, sessionStorage, IndexedDB, and service workers.

Key Features:

View & Edit Storage

Access localStorage, sessionStorage, and IndexedDB. Edit, add, or delete entries.

Manage Cookies

View all cookies for the site. Edit values, expiration dates, or delete cookies.

Service Workers

Debug Progressive Web Apps (PWAs), test offline functionality, and manage cache.

Clear Site Data

Quickly clear all storage, cookies, and cache for testing fresh state.

Pro Tips & Workflows

Use Device Mode for Responsive Testing

Click the device icon (Ctrl+Shift+M) to test your site on different screen sizes and devices. Select from preset devices or enter custom dimensions.

Command Menu Shortcuts

Press Ctrl+Shift+P (Cmd+Shift+P on Mac) to open the Command Menu. Quickly access features like "Screenshot", "Disable JavaScript", or "Clear Cache".

Console Helpers

Use $ shortcuts: $0 (selected element), $(selector) like jQuery, $$('div') (querySelectorAll), copy(value) to copy to clipboard.

Preserve Log Across Page Loads

In Console and Network panels, enable "Preserve log" to keep entries after page navigation or reload—essential for debugging redirects.

Force State for CSS

Right-click an element → Force State to test :hover, :active, :focus, and :visited styles without manual interaction.

Local Overrides

Save changes made in DevTools to local files. Right-click in Sources → "Save for overrides" to test changes persistently.