Tools
Log in
English

Browser DevTools (F12) guide

How to use the developer tools that open with F12 in your browser, written in plain words with steps you can try in the playground.

Open in the playground All HTML elements All CSS properties

Open and close DevTools

Open, close and move the browser's developer tools (DevTools).

Web pageElementsConsoleSourcesNetworkDevTools (dock: bottom)F12Ctrl+Shift+ICmd+Option+IRight-click > InspectDock side:bottom, left, right, window

What it does

Every desktop browser comes with developer tools, a set of panels for looking inside the page you have open. You can read the HTML, change CSS on the spot, run JavaScript and watch every file the page downloads. Changes made there stay in your browser only, and a reload puts the page back the way it was.

How to open it

Press F12 or Ctrl+Shift+I (Mac: Cmd+Option+I). You can also right-click any part of the page and choose Inspect.

Step by step

  1. Open any page and press F12. The tools appear at the side or bottom of the window.
  2. Press F12 again, or click the X at the top right of the tools, to close them.
  3. Right-click a button or heading and choose Inspect. The tools open with that element already selected.
  4. To move the tools, open the three-dot menu at the top right of DevTools and pick a dock side: bottom, left, right or a separate window.
  5. In Chrome and Edge, Ctrl+Shift+D (Mac: Cmd+Shift+D) jumps back to the previous dock position.
  6. In Safari, turn on the developer features in Settings first (see the table), then press Cmd+Option+I.

Try it in this playground

Paste the example into the lab and run it. Right-click the pink button in the result pane and choose Inspect. DevTools opens with the button's tag highlighted in the HTML tree. Open in the playground

BrowserHow to openGood to know
ChromeF12, Ctrl+Shift+I, Mac Cmd+Option+I, right-click > InspectMain panels: Elements, Console, Sources, Network, Application, Performance, Lighthouse
EdgeSame keys as ChromeBuilt on the same engine as Chrome, so the panels and keys match
FirefoxF12, Ctrl+Shift+I, Mac Cmd+Option+I, right-click > InspectSome panels have other names: Inspector, Debugger, Storage
SafariCmd+Option+I, or right-click > Inspect ElementTurn it on first: Safari > Settings > Advanced > Show features for web developers (older versions: Show Develop menu in menu bar)

Keys and names

F12open or close DevTools (Windows, Linux)
Ctrl+Shift+Iopen or close DevTools (Mac: Cmd+Option+I)
Inspectright-click menu item that opens DevTools on that element
Dock sidewhere the tools sit: bottom, left, right or own window
Ctrl+Shift+Dswitch to the previous dock position (Chrome, Edge; Mac: Cmd+Shift+D)

Where people get stuck

If F12 does nothing on a laptop, the F keys may be set to volume or brightness; hold Fn and press F12, or use Ctrl+Shift+I. Some school or office computers turn DevTools off by policy.

Elements

See the page as a live HTML tree and change its HTML and CSS on the spot.

ElementsConsoleSourcesNetworkHTML tree<body><div class="row">flex<div class="card"> == $0<h2>One</h2><button>Ctrl+Shift+C: pickStylesComputed:hov+.card {padding: 16px;background: ...;}contentmargin

What it does

The Elements panel shows the page as a tree of tags on the left and the CSS rules for the selected tag on the right. You can edit both and see the result at once. It is the quickest way to find out why a box is too wide, a color is off, or a rule does not apply. Firefox calls this panel Inspector.

How to open it

Press Ctrl+Shift+C (Mac: Cmd+Shift+C) and click something on the page, or right-click it and choose Inspect.

Step by step

  1. Press Ctrl+Shift+C, move the mouse over the page and click a box. Its tag is selected in the tree.
  2. Double-click a tag name, an attribute or some text to change it. To rewrite a whole block, right-click the tag and choose Edit as HTML.
  3. In Styles, untick the checkbox next to a property to switch it off. Click a value to type a new one; the Up and Down keys change numbers by 1, with Shift by 10.
  4. Click + (New Style Rule) to add a rule for the selected element, or click inside element.style to add a property to this one element only.
  5. Open Computed to see the final value of every property and the box model diagram: margin, border, padding and content, in pixels.
  6. Click :hov and tick :hover, :focus or :active. The element keeps that state, so you can style it without holding the mouse still.
  7. Click the flex or grid badge next to a tag in the tree to draw its lines, gaps and areas over the page.

Try it in this playground

Run the example and pick the first card with Ctrl+Shift+C. Untick padding in Styles and watch the card shrink. Pick a button, turn on :hover with :hov and the pink color stays. Click the flex badge on .row to see the gap drawn. Open in the playground

Keys and names

Ctrl+Shift+Cpick an element on the page (Mac: Cmd+Shift+C)
Edit as HTMLright-click item to rewrite a tag and everything inside it
StylesCSS rules that match the selected element
element.styleinline style on this one element
Computedfinal values after every rule is applied
Box modeldiagram of margin, border, padding and content
:hovforce :hover, :focus, :active and other states
flex / grid badgeclick to show the layout overlay
Hhide or show the selected element (Chrome, Edge)

Where people get stuck

Everything you change here is gone after a reload, so copy the working CSS back into your file. A struck-through line lost to another rule or has a value the browser does not accept.

Console

Read messages from your code and run JavaScript right on the page.

ElementsConsoleSourcesNetworktopvFilterDefault levelsPage readyscript.js:1Stock is lowscript.js:4Price missing for item 3script.js:5> $0.textContent< "Shop list"

What it does

The Console lists what your scripts print and every error the browser finds. You can also type JavaScript there and it runs on the open page at once, which is handy for testing a line or reading a value. Messages show the file and line they came from, so you can jump to the code.

How to open it

Press Ctrl+Shift+J (Mac: Cmd+Option+J) to open DevTools on the Console. In Firefox it is Ctrl+Shift+K (Mac: Cmd+Option+K).

Step by step

  1. Open the Console with Ctrl+Shift+J, or open DevTools and click the Console tab.
  2. In your code, console.log prints plain values, console.warn prints a yellow line and console.error a red one. console.table shows an array of objects as a table.
  3. Click the file name and line number at the right of a message to open that line in Sources.
  4. Pick an element in Elements, come back to the Console and type $0. It stands for the element you picked; try $0.textContent.
  5. Type in the Filter box to show only lines that match, or use the levels menu (Chrome: Default levels) to hide info or warnings.
  6. Type 0.1 + 0.2 or new Date() and press Enter to get the answer at once. Shift+Enter adds a new line without running.
  7. Clear the list with Ctrl+L (Mac: Cmd+K) or by calling console.clear().

Try it in this playground

Run the example, then open the Console. You will see a table of items, a yellow warning and a red error. Click the file name at the right of the red line to jump to it. Remember that the result pane is a separate frame; see the entry on using DevTools in this lab. Open in the playground

Keys and names

console.log()print values
console.warn()yellow warning line
console.error()red error line with a stack
console.table()show an array or object as a table
$0the element selected in Elements
Filtershow only lines with this text
Default levelsmenu to hide or show Verbose, Info, Warnings, Errors (Chrome, Edge)
Shift+Enternew line without running
Ctrl+Lclear the Console (Mac: Cmd+K)

Where people get stuck

If a message does not appear, check that the Filter box is empty and the levels menu has not hidden that type. When you expand a logged object later, you see its values at that moment, which may differ from when the line ran.

Sources

Pause JavaScript on any line and run it one step at a time.

ConsoleSourcesNetworkF8F10F11Shift+F11Filesindex.htmlscript.js1function addTax(p) {2const tax = ...3return p + tax;4}debugger;WatchScopep: 1200tax: 120Call StackaddTax

What it does

Sources shows the files the page loaded and lets you stop the code with breakpoints. While paused, you can read every variable and move forward one line at a time. This finds bugs that console.log alone cannot explain. Firefox calls this panel Debugger.

How to open it

Open DevTools and click Sources (Firefox: Debugger). Ctrl+P (Mac: Cmd+P) opens a file by name.

Step by step

  1. Open Sources and pick a file in the left tree, or press Ctrl+P and type part of its name.
  2. Click a line number to set a breakpoint. When the code reaches that line, it stops before running it.
  3. While paused, hover a variable to read its value, or look at Scope on the right for every local value. Add a name to Watch to follow it.
  4. Press F10 to run the next line, F11 to step into a function, Shift+F11 to step out, and F8 to continue until the next breakpoint.
  5. Right-click a line number, choose Add conditional breakpoint and type a test such as p === 450. It stops only when the test is true.
  6. Write debugger; in your code to stop there whenever DevTools is open. Delete it when you are done.

Try it in this playground

Open DevTools first, then run the example. The code stops at debugger; when p is 3000. Press F11 to enter addTax and watch tax and total change in Scope, then F8 to go on. Next, right-click a line number in that file and add a conditional breakpoint with p === 450. Open in the playground

Keys and names

Breakpointclick a line number to stop there
Conditional breakpointstop only when a test is true
debugger;stop at this line from code
Scopelocal and global values while paused
Watchvalues you chose to follow
Call Stackthe chain of calls that led here
F8continue (Mac: F8 or Cmd+\)
F10next line, step over calls (Mac: F10 or Cmd+')
F11step into a function (Mac: F11 or Cmd+;)
Shift+F11step out of a function (Mac: Shift+F11 or Cmd+Shift+;)

Where people get stuck

debugger; does nothing while DevTools is closed. Breakpoints stay after a reload; if the page keeps stopping where you do not expect, remove them in the Breakpoints list.

Network

List every file the page downloads, with status, size and time.

ConsoleSourcesNetworkApplicationDisable cacheNo throttlingPreserve logNameStatusTypeSizeTimeWaterfallindex.html200document3.1 kB40 msstyle.css304stylesheet(disk cache)2 msapp.js200script18 kB120 mslogo.png404png0.2 kB30 msCtrl+Shift+R: hard reload

What it does

The Network panel lists every request the page makes: HTML, CSS, scripts, images, fonts and data calls. Each row shows the status code, size and how long it took. It records only while DevTools is open, so open it first and then reload. It is also where you find out why an old file keeps showing after you changed it.

How to open it

Open DevTools, click Network, then press F5 to reload and fill the list.

Step by step

  1. Open Network and reload the page. Each row is one request.
  2. Read Status: 200 is OK, 304 means the browser reused its stored copy, 404 means the file was not found, 500 means the server failed.
  3. Size shows bytes sent over the wire. (memory cache) or (disk cache) means the browser used its stored copy and did not ask the server.
  4. Time and the Waterfall bars show which files are slow. Click a row to see Headers, Preview and Response.
  5. Tick Disable cache. While DevTools stays open, every reload fetches fresh files.
  6. Open the throttling menu (it says No throttling) and pick a slower preset to see how the page loads on a weak connection.
  7. Press Ctrl+Shift+R (Mac: Cmd+Shift+R) for a hard reload that skips the stored copy for this load.

Try it in this playground

Open Network, then run your code in the lab again and watch which rows appear. Switch the throttling menu to a slow preset and run it once more to compare the times. Set it back to No throttling when you finish. Open in the playground

What you seeLikely causeTry this
Size shows (memory cache) or (disk cache)The browser used its stored copyCtrl+Shift+R, or tick Disable cache and reload
Status 304The server says the file has not changedCheck that the new file really reached the server, then hard reload
Size shows (ServiceWorker)A service worker answers with an old copyApplication > Service workers: Unregister, or tick Update on reload
The row asks for an old file nameThe HTML still links the old fileFix the link, or add a version such as style.css?v=2
Still old after all of thisA cache on the server side or in betweenClear that cache, or wait for its time limit

Keys and names

Status200 OK, 304 not changed, 404 not found, 500 server error
Sizebytes sent, or (memory cache) / (disk cache)
Time / Waterfallhow long each request took and when
Disable cachealways fetch fresh files while DevTools is open
Throttlingpretend to be on a slow connection
Preserve logkeep the list after a reload or page change
Ctrl+Shift+Rhard reload (Mac: Cmd+Shift+R; Windows also Ctrl+F5)
Empty Cache and Hard Reloadright-click the reload button while DevTools is open (Chrome, Edge)

Where people get stuck

Leaving throttling or Disable cache on makes every site slow while DevTools is open. If the list is empty, DevTools was opened after the page loaded; reload once.

Device mode

Shrink the page to a phone or tablet screen inside your desktop browser.

Dimensions: Responsive390 x 844rotateCtrl+Shift+Mtouchdrag edgedrag edge

What it does

Device mode shows the page at a phone or tablet size, sends touch events instead of mouse events and can turn the screen sideways. It is a quick check for media queries and small screens. It copies the size and touch, but not the real phone browser, so test on a real phone before release.

How to open it

Open DevTools and press Ctrl+Shift+M (Mac: Cmd+Shift+M), or click the phone and tablet icon at the top left of DevTools. In Firefox it is called Responsive Design Mode (Ctrl+Shift+M, Mac: Cmd+Option+M).

Step by step

  1. Press Ctrl+Shift+M. A toolbar appears above the page.
  2. Pick a device from the Dimensions menu, or keep Responsive and drag the edges to any width.
  3. Click the rotate icon to switch between portrait and landscape.
  4. On mobile presets the pointer turns into a round touch dot and clicks act like taps.
  5. Drag slowly from wide to narrow and watch where the layout breaks. Those widths are where a media query helps.
  6. If the page reads the screen size only once when it loads, reload after changing the device.
  7. Press Ctrl+Shift+M again to go back to the normal view.

Try it in this playground

Run the example and open device mode. Make the screen narrow: once the result pane itself is under 500px wide, the boxes stack and turn pink. The console prints the new width each time the size changes. Open in the playground

Keys and names

Ctrl+Shift+Mtoggle device mode (Mac: Cmd+Shift+M; Firefox Mac: Cmd+Option+M)
Responsivefree size; drag the edges
Dimensionsmenu of phone and tablet presets
Rotateportrait or landscape
Touchclicks become taps on mobile presets
Device pixel ratiohow many screen dots make one CSS pixel

Where people get stuck

Device mode changes screen size, pixel ratio, touch and the browser name the page sees, but the engine stays your desktop one. Small differences can still show on a real iPhone or Android phone.

Application

Read, edit and delete cookies, localStorage and other data a site keeps.

ConsoleNetworkApplicationFirefox: StorageStorageLocal storageSession storageIndexedDBCookiesClear site dataNameValueExpiresHttpOnlythemedarkSessionlangko2027-01sida81f...2026-12yesDelete key: remove row

What it does

The Application panel shows what a site has saved in your browser: cookies, localStorage, sessionStorage, IndexedDB and cache storage. You can read each value, change it or delete it. Firefox puts the same things in its Storage panel, and Safari in its Storage tab.

How to open it

Open DevTools and click Application (behind the >> arrow if the tab row is narrow). In Firefox open Storage, or press Shift+F9.

Step by step

  1. Under Storage in the left list, open Cookies and click the site address. Each row shows name, value, domain, path, expiry and flags such as HttpOnly and Secure.
  2. Double-click a value to edit it. Select a row and press Delete to remove it; the clear icon above the table removes them all.
  3. Open Local storage and click the site address to see the key and value pairs saved with localStorage.setItem.
  4. Session storage works the same way but empties when the tab closes.
  5. To start fresh, click Storage at the top of the list (Chrome, Edge) and press Clear site data.
  6. Reload after deleting to see how the page behaves for a first-time visitor.

Try it in this playground

Run the example; it saves a visit number in localStorage. In Application > Local storage, open the run.appdogu.com entry to see the demo-visits key. Delete it and run again: the number starts over at 1. If the console says storage is blocked, the steps still work the same way on any normal page. Open in the playground

Keys and names

Cookiessmall values sent to the server with each request
Local storagekey and value pairs that stay after closing the browser
Session storagelike local storage, but cleared when the tab closes
IndexedDBlarger structured data saved by scripts
HttpOnlycookie that JavaScript cannot read
Clear site dataremove everything this site saved (Chrome, Edge)
Shift+F9open Storage in Firefox

Where people get stuck

Cookies marked HttpOnly cannot be read from JavaScript, but they still show here. Deleting a login cookie signs you out of that site.

Performance and Lighthouse

Record what slows a page down and get scores for speed and accessibility.

NetworkPerformanceLighthouseRecordlong taskBottom-Up: slowest first9278PerformanceAccessibilityAnalyze page load

What it does

Performance records what the browser does over time: running scripts, working out styles and drawing the screen. Lighthouse runs a set of checks and gives scores from 0 to 100 for Performance, Accessibility, Best Practices and SEO, with a list of things to fix. Lighthouse is in Chrome and Edge; Firefox has its own Performance panel but no Lighthouse.

How to open it

Open DevTools and click Performance or Lighthouse. If you cannot see them, open the >> arrow at the end of the tab row.

Step by step

  1. In Performance, click the reload-and-record button to record while the page loads, or press Record, use the page, then press Stop.
  2. In the result, look for wide yellow blocks (scripts) and tasks marked in red, which took too long. Click one to see which function ran.
  3. Open the Bottom-Up tab to sort functions by time spent; the slowest are at the top.
  4. In Lighthouse, choose Mobile or Desktop, tick the categories you want and click Analyze page load.
  5. Read the scores. Open the items under each one to see what went wrong and which element it points at.
  6. Fix one thing, run the check again and compare.

Try it in this playground

Run the example with Performance recording: press Record, run the code, then Stop. Find the long task and click it to reach the loop. The console also prints how many milliseconds the loop took. Lighthouse checks the address in the tab, so here it scores the lab page; open your own page in its own tab to score it. Open in the playground

Keys and names

Recordstart and stop a recording
Reload and recordrecord the page load from the start
Long taska task over 50 ms, marked in red
Bottom-Upfunctions sorted by time spent
Lighthousescores for Performance, Accessibility, Best Practices, SEO
Analyze page loadstart a Lighthouse check
console.time()measure the time between two points in your code

Where people get stuck

Scores move a little from run to run, and browser extensions can slow the page. A guest or incognito window gives steadier numbers. A high accessibility score is a good start, but some problems only a person can find.

Using DevTools in this lab

Switch the F12 console to the result pane frame to reach your own code.

top: lab pageeditorresult paneiframerun.appdogu.comlab Console tabConsole (F12)topvtoprun.appdogu.compick run.appdogu.comto reach your elementsand variables

What it does

The result pane in this lab is an iframe loaded from run.appdogu.com, a different address from the editor page. DevTools treats it as a separate frame. The F12 console starts on top, the lab page, so your variables and elements are out of reach until you switch the console to the run.appdogu.com frame.

How to open it

Open F12 > Console, click the menu at the top left of the console that says top, and choose run.appdogu.com.

Step by step

  1. Run your code so the result pane shows something.
  2. Press F12 and open Console. At the top left there is a menu that says top.
  3. Open it and choose run.appdogu.com. Code you type now runs inside the result pane, so document.querySelector('h1') finds your heading.
  4. Switch back to top when you want to look at the lab page itself.
  5. In Elements, open the iframe tag and its #document to see your HTML, or press Ctrl+Shift+C and click straight inside the result pane.
  6. For a quick look, use the lab's own Console tab under the editor. It shows console.log lines and errors from the result pane without F12, and clicking a line number takes you to that line in the editor.

Try it in this playground

Run the example, open the F12 console and type myGreeting while the menu says top: you get a ReferenceError. Switch to run.appdogu.com and type it again: you get the text. Type document.querySelector('h1').textContent too. Open in the playground

Lab Console tabF12 Console
WhereUnder the editor in the labBrowser DevTools
What it showsconsole.log lines and errors from your codeMessages from every frame plus the browser's own
Clicking a lineJumps to that line in the lab editorOpens the line in Sources
Frame choiceNot neededPick run.appdogu.com to reach your code

Keys and names

topthe lab page with the editor and buttons
run.appdogu.comthe result pane iframe where your code runs
Lab Console tabconsole.log lines and errors from the result pane; click a line number to jump
F12 Consolethe full browser console for every frame
#documentthe inner page of an iframe in the Elements tree

Where people get stuck

If your variable is "not defined" or querySelector returns null, look at the frame menu first; it is probably still on top. Firefox has a similar frame picker.

DevTools shortcuts

One table of the DevTools keys you will use most.

What it does

These keys work in Chrome and Edge, and most of them in Firefox too. Where Firefox or the Mac differs, the table says so. Most of them work only while DevTools has focus, so click inside the tools first.

How to open it

Keep this table open next to the lab and try each key once.

Step by step

  1. Press F12 to open DevTools and click inside it.
  2. Press Ctrl+Shift+P (Mac: Cmd+Shift+P) and type a word such as screenshot or dock to find any command.
  3. Press Ctrl+P (Mac: Cmd+P) to open a file by name in Sources.
  4. Press Ctrl+Shift+F (Mac: Cmd+Option+F) to search text in every loaded file.
  5. While paused at a breakpoint, use F10, F11, Shift+F11 and F8 to move through the code.

Try it in this playground

Run any example, open DevTools and go through the table from top to bottom. Ctrl+Shift+C, then a click in the result pane, is the one you will use most. Open in the playground

ActionWindows / LinuxMac
Open or close DevToolsF12 or Ctrl+Shift+ICmd+Option+I
Pick an elementCtrl+Shift+CCmd+Shift+C
Open the ConsoleCtrl+Shift+J (Firefox: Ctrl+Shift+K)Cmd+Option+J (Firefox: Cmd+Option+K)
Device modeCtrl+Shift+MCmd+Shift+M (Firefox: Cmd+Option+M)
Hard reloadCtrl+Shift+R or Ctrl+F5Cmd+Shift+R
Command menuCtrl+Shift+P (Chrome, Edge)Cmd+Shift+P (Chrome, Edge)
Open a fileCtrl+PCmd+P
Search all filesCtrl+Shift+FCmd+Option+F (Firefox: Cmd+Shift+F)
Find in this panelCtrl+FCmd+F
Continue (resume)F8F8 or Cmd+\
Next line (step over)F10F10 or Cmd+'
Step intoF11F11 or Cmd+;
Step outShift+F11Shift+F11 or Cmd+Shift+;
Clear the ConsoleCtrl+L (Firefox: Ctrl+Shift+L)Cmd+K
Switch dock sideCtrl+Shift+D (Chrome, Edge)Cmd+Shift+D (Chrome, Edge)

Keys and names

Ctrl+Shift+Pcommand menu (Chrome, Edge)
Ctrl+Popen a file
Ctrl+Shift+Fsearch all files
Escshow or hide the Console drawer under other panels (Chrome, Edge)

Where people get stuck

On many laptops the F keys control volume or brightness; hold Fn with them. In Firefox, Ctrl+Shift+P opens a private window instead of a command menu.