Skip to content
DN
Esc
  • JSON FormatterBeautify, minify and validate JSON instantly as you type.
  • Base64 Encoder/DecoderConvert text to Base64 and back, with full Unicode support.
  • UUID GeneratorGenerate random v4 UUIDs — one or many — in the format you need.
  • JWT DecoderDecode JSON Web Tokens to inspect the header, payload and expiry.
  • Timestamp ConverterConvert Unix timestamps to dates and dates to timestamps.
  • URL Encoder/DecoderPercent-encode and decode URLs, and break down query strings.
  • Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.
  • Regex TesterTest regular expressions with live match highlighting and groups.

↑ ↓ to moveEnter to openPaste data to open it in the right tool. Nothing leaves your browser.

JSON Formatter & Validator

Paste JSON to beautify, minify and validate it instantly. Errors show the exact line and column, and everything runs in your browser.

Last updated

Indent
Waiting for input

Input

Output

Formatted JSON will appear here

Paste something on the left, or

How to use the JSON Formatter

  1. Paste your JSON

    Paste or type JSON into the Input panel, or click Sample to try an example.

  2. Check that it's valid

    The status badge updates as you type. If there's an error, the Output panel shows where it is.

  3. Format or minify

    Choose Format (beautify) with 2 spaces, 4 spaces or tabs, or Minify — and optionally sort keys.

  4. Copy or download

    Copy the result to your clipboard, or download it as a .json file.

Features

  • Live validation as you type, with a Valid / Invalid status badge
  • Error messages with the exact line and column, a preview of the problem line and a Jump to error button
  • Format (beautify) with 2-space, 4-space or tab indentation, or minify to a single line
  • Validate button that reports the result and jumps straight to any error
  • Keyboard shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + S downloads it
  • Sort object keys alphabetically at every level (array order is preserved)
  • Syntax highlighting for keys, strings, numbers, booleans and null
  • Open a .json file or drop it onto the input; copy, download as .json, or paste from your clipboard
  • Remembers your indentation, output style and Sort keys setting (never your JSON)
  • Size, line and character counts, plus the number of keys and nesting depth

Is my JSON uploaded?

No. Your JSON is parsed with your browser's built-in JSON.parse and formatted on your device. This tool has no server-side processing: the text you paste isn't sent over the network, stored or logged, and it's gone when you close or reload the page.

Read the DevNest privacy policy

Examples

  • Beautify a minified API response

    Paste one-line JSON from an API and get readable, indented output.

    Input

    {"id":1,"name":"Ada Lovelace","roles":["admin","dev"],"active":true,"manager":null}

    Output (Format, 2 spaces)

    {
      "id": 1,
      "name": "Ada Lovelace",
      "roles": [
        "admin",
        "dev"
      ],
      "active": true,
      "manager": null
    }
  • Find a syntax error

    A trailing comma makes this invalid JSON. The error shows exactly where it is.

    Input

    {"name": "Ada", "age": 36,}

    Result

    Invalid JSON: Expected double-quoted property name
    Line 1, column 27
  • Format an array of objects

    Arrays of records — like rows from a database or an export — become easy to scan.

    Input

    [{"sku":"A-100","qty":2,"price":9.5},{"sku":"B-200","qty":1,"price":24}]

    Output (Format, 2 spaces)

    [
      {
        "sku": "A-100",
        "qty": 2,
        "price": 9.5
      },
      {
        "sku": "B-200",
        "qty": 1,
        "price": 24
      }
    ]

Understanding JSON

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for structured data. It's built from objects of key/value pairs in {}, arrays in [], double-quoted strings, numbers, true, false and null. APIs, configuration files such as package.json, logs and many databases use it.

{
  "name": "DevNest",
  "tools": 8,
  "free": true,
  "tags": ["json", "jwt"],
  "owner": null
}

What does a JSON formatter do?

APIs usually send minified JSON: one long line with no whitespace. That's efficient, but hard to read. A JSON formatter — also called a beautifier or pretty-printer — parses the text and rewrites it with line breaks and consistent indentation so the structure is easy to follow.

Because the JSON has to be parsed first, formatting also validates it. If the text isn't valid JSON it can't be formatted, and you get an error that points to the problem instead.

JSON formatter vs JSON minifier

AspectFormat (beautify)Minify
WhitespaceAdds line breaks and indentationRemoves all optional whitespace
Best forReading, debugging, code reviewNetwork requests, storage, embedding
SizeLargerAs small as possible
DataUnchangedUnchanged

Both produce exactly the same data — only whitespace changes. The Sort keys option is different: it reorders object properties, which doesn't change the meaning of the JSON but does change the text.

Common JSON syntax errors

  • Trailing commas, as in [1, 2, ] or {"a": 1,}
  • Single quotes: {'a': 1} — JSON requires double quotes
  • Unquoted keys: {a: 1}
  • Comments such as // note — JSON doesn't allow them
  • A missing comma between two items
  • Values like undefined, NaN or Infinity, which aren't valid JSON

DevNest uses your browser's strict JSON parser, so it reports errors the same way JSON.parse would in your own JavaScript code.

Frequently asked questions

Can DevNest validate JSON?

Yes. Your input is checked every time it changes. Valid JSON shows a green Valid JSON badge; invalid JSON shows the error message, the line and column, and a button that jumps to the problem in your input.

Can DevNest minify JSON?

Yes. Choose Minify to remove all optional whitespace, then copy the result or download it as a .json file.

Does it support JSON with comments (JSONC) or JSON5?

No. DevNest follows the standard JSON format, which doesn't allow comments, trailing commas or single quotes. Remove them first — the error panel points to each one.

What does Sort keys do?

It orders the properties of every object alphabetically, including nested objects. The order of items inside arrays is never changed. This makes two JSON documents easier to compare.

Why did a very large number change after formatting?

JavaScript numbers can only represent integers exactly up to 9,007,199,254,740,991. Larger integers, such as some database IDs, lose precision when parsed. Store such values as strings if the exact digits matter.

Is there a size limit?

There's no fixed limit because everything runs in your browser, so very large files depend on your device's memory. Syntax highlighting is switched off for output longer than 200,000 characters to keep typing responsive.