Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog
Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog

View and edit local storage

Published on

This guide shows you how to use Chrome DevTools to view, edit, and delete localStorage key-value pairs.

View localStorage keys and values

  1. Click the Application tab to open the Application panel. Expand the Local Storage menu.

    The Local Storage Menu

    Figure 2. The Local Storage menu shows two domains: https://developers.google.com and https://www.youtube.com

  2. Click a domain to view its key-value pairs.

    The localStorage key-value pairs for the https://www.youtube.com domain

    Figure 3. The localStorage key-value pairs for the https://www.youtube.com domain

  3. Click a row of the table to view the value in the viewer below the table.

    Viewing the value of the yt-remote-connected-devices key

    Figure 4. Viewing the value of the yt-remote-connected-devices key

Create a new localStorage key-value pair

  1. View a domain's localStorage key-value pairs.

  2. Double-click the empty part of the table. DevTools creates a new row and focuses your cursor in the Key column.

    The empty part of the table to double-click in order to create a new key-value pair

    Figure 5. The empty part of the table to double-click in order to create a new key-value pair

Edit localStorage keys or values

  1. View a domain's localStorage key-value pairs.

  2. Double-click a cell in the Key or Value column to edit that key or value.

    Editing a localStorage key

    Figure 6. Editing a localStorage key

Delete localStorage key-value pairs

  1. View a domain's localStorage key-value pairs.
  2. Click the key-value pair that you want to delete. DevTools highlights it blue to indicate that it's selected.
  3. Press the Delete key or click Delete Selected Delete Selected.

Delete all localStorage key-value pairs for a domain

  1. View a domain's localStorage key-value pairs.
  2. Click Clear All Clear All.

Interact with localStorage from the Console

Since you can run JavaScript in the Console, and since the Console has access to the page's JavaScript contexts, it's possible to interact with localStorage from the Console.

  1. Use the JavaScript contexts menu to change the JavaScript context of the Console if you want to access the localStorage key-value pairs of a domain other than the page you're on.

    Changing the JavaScript context of the Console

    Figure 7. Changing the JavaScript context of the Console

  2. Run your localStorage expressions in the Console, the same as you would in your JavaScript.

    Interacting with localStorage from the Console

    Figure 8. Interacting with localStorage from the Console

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.