Skip to content

Instantly share code, notes, and snippets.

View russmatney's full-sized avatar

Russell Matney russmatney

View GitHub Profile
@russmatney
russmatney / console.js
Created November 14, 2025 23:48 — forked from amitmerchant1990/console.js
Calculate used localStorage size for a website
let entries = [];
let totalSize = 0;
// Collect all localStorage entries with their sizes
for (let key in localStorage) {
if (localStorage.hasOwnProperty(key)) {
let keySize = new Blob([key]).size; // Size of the key
let valueSize = new Blob([localStorage[key]]).size; // Size of the value
let totalEntrySize = keySize + valueSize;
totalSize += totalEntrySize;