Skip to content
4all.tools

Analyze JSON Size, Types and Depth

Measure JSON size in UTF-8 bytes, compare the savings from minification and inspect its values, arrays and depth.

Tool workspace

JSON Size Analyzer

Enable JavaScript to analyze JSON locally in your browser.

Analyze one strict JSON document, including primitive roots. Duplicate decoded keys are rejected. Analysis starts only when you press Analyze JSON.

Your JSON and report stay in this browser tab. Nothing is uploaded or saved.

Current text: up to 1000000 UTF-16 units and 4000000 UTF-8 bytes; file: 4000000 bytes; container depth: 200; nodes: 100000.

Current text

Parsing: 1000000 work units; measurement: 1000000 units; analysis: 100000 visits; rankings: 4000000 comparisons. Each full path: 10000 units; combined paths: 400000. Timeout: 15000 ms. A path or work budget can be exceeded even when input size and node count fit.

Enable JavaScript to analyze JSON locally in your browser.

    Find out how much space your JSON takes

    Paste JSON or open a UTF-8 .json file, then press Analyze JSON. The report measures the text in the editor, counts its values and shows its deepest paths and largest arrays. Processing stays in your browser; your document and report are not uploaded or saved.

    The input must be strict JSON. Comments, trailing commas and duplicate keys are rejected. A single value such as null, 42 or "" is valid, as are {} and [].

    Why bytes and length differ

    UTF-8 bytes measure the space needed to encode the text. UTF-16 length counts the units used by JavaScript strings. Neither is a count of visible characters.

    For example, {"é":"😀"} has 13 UTF-8 bytes and 10 UTF-16 units. Writing "\u00E9" instead of "é" takes more bytes even though both represent the same string. KiB and MiB use multiples of 1024.

    The measurement includes spaces and an initial BOM, if present. Because the editor can normalize line endings, its result may differ from the original file size.

    What minification saves

    The report compares the current text with a version that removes spaces, tabs and line breaks outside strings, plus one initial BOM. It preserves spaces inside strings, key order, escapes and number spellings such as 1.0, 1e0, -0 and 9007199254740993. A second initial BOM is invalid.

    Try this example:

    {"a":[null,{"b":true}],"c":"x"}

    It already has no formatting whitespace: both sizes are 31 bytes, so the saving is zero. It contains 6 values and 3 object keys: 2 objects, 1 array, 1 null, 1 boolean and 1 string.

    These are text sizes, not estimates of gzip/Brotli compression, HTTP traffic, memory use or AI tokens. This tool does not download a minified file or export the report.

    Read the structure report

    Each value counts once, including the root and empty containers. Keys count separately. Type percentages describe numbers of values, not their share of the bytes.

    Path depth starts at zero for the root. Container depth counts the objects and arrays along a path. Both reach 3 in the example. The array $.a has 2 direct elements; its deepest value is $.a[1].b.

    Each detail list shows up to 20 entries. The largest arrays are ranked by their number of direct elements, not by bytes. Equal scores keep source order. Omitted detail rows do not affect the totals, which cover the whole document.

    Use Copy path to copy a full path or Locate in input to select its value. After editing the input, run the analysis again.

    Working with large documents

    Limit Maximum
    File size and UTF-8 text size 4,000,000 bytes
    Text length 1,000,000 UTF-16 units
    Nested containers 200 levels
    Values 100,000
    Analysis time 15 seconds

    Long paths or complex documents can reach processing limits before these maxima. If analysis fails, no partial report is shown. A precision warning does not mean the measured number text was rounded; numbers outside the supported range, such as 1e999, are rejected.

    JavaScript and a browser that supports Workers are required. Canceling keeps your input so you can shorten it and try again.