JSON Formatter & Validator

Updated July 2026

Paste JSON to instantly beautify, validate or minify it. The tool pretty-prints messy JSON, checks that it is valid, and can shrink it to its smallest form — all without leaving your browser.

Paste JSON to instantly format (pretty-print), validate, or minify it. Everything runs in your browser — your data is never uploaded. Invalid JSON shows the exact error.
Ready. Paste JSON above and choose an action.

How this JSON formatter works

JSON (JavaScript Object Notation) is a lightweight text format for storing and transferring structured data. This tool reads your JSON with the browser's built-in parser, so the rules it enforces are exactly the rules every standards-compliant JSON consumer follows: double-quoted keys and strings, no trailing commas, and no comments.

Formatting (beautifying) re-serialises valid JSON with consistent indentation and line breaks, turning a dense one-liner into a readable, nested structure. Minifying does the opposite — it strips every optional space and newline to produce the smallest equivalent payload, which is ideal for network transfer. Validating simply checks whether the text parses, reporting the exact error when it does not.

Worked example: the input {"name":"Ada","langs":["Lisp","Ada"],"active":true} formats with 2-space indentation to a 6-line, easy-to-scan block — and minifies back to the same single line. It reports 3 keys, a depth of 2 (the object contains an array), and its byte size. A version with a trailing comma — {"name":"Ada",} — fails validation and shows the parser error instead.

When parsing fails, the tool surfaces the browser's own error message and, where the engine provides it, the character position of the problem. Below are the mistakes that trip people up most often.

Common errorExampleFix
Trailing comma{"a":1,}Remove the comma after the last item
Single quotes{'a':1}Use double quotes for keys and strings
Unquoted key{a:1}Wrap keys in double quotes: {"a":1}
Missing comma{"a":1 "b":2}Separate items with a comma
Comments{"a":1 // note}JSON has no comments — remove them
Unescaped quote{"a":"he said "hi""}Escape inner quotes: \"hi\"

Reference note: this tool follows the strict JSON grammar (RFC 8259). Formats such as JSON5 or JSONC that allow comments and trailing commas are not valid JSON and will be reported as errors.

Frequently asked questions

How do I format / beautify JSON?
Paste your JSON into the box and press Format. The tool parses it and pretty-prints it with consistent indentation (2 spaces by default), adding line breaks and nesting so the structure is easy to read.
How do I validate JSON?
Paste your JSON and press Validate. If it is valid you will see a confirmation plus stats for the number of keys, nesting depth and byte size. If it is invalid, the exact parser error message is shown, often with the position of the problem.
What's the difference between formatting and minifying?
Formatting (beautifying) adds whitespace and indentation to make JSON readable. Minifying removes every unnecessary space and line break to make the payload as small as possible. Both produce equivalent data.
Why am I getting a JSON parse error?
The most common causes are trailing commas after the last item, single quotes instead of double quotes, unquoted object keys, missing commas between items, and stray comments. Strict JSON requires double-quoted keys and strings and no trailing commas.
Is my JSON uploaded anywhere?
No. All parsing, formatting, validation and minifying happen locally in your browser. Your JSON is never sent to a server, so it is safe to paste sensitive data.
How do I minify JSON?
Paste your JSON and press Minify. The tool re-serialises it with no spaces or line breaks, producing the smallest valid representation of the same data, which you can copy with the Copy button.
⚡ JSON Formatter & Validator — by larely ↗

Related tools

Morse Code Translator

Translate text to Morse code and back, with audio playback.

Password Generator

Generate strong, random passwords and passphrases privately in your browser.

Base64 Encoder / Decoder

Encode and decode Base64 text in your browser.

Lorem Ipsum Generator

Generate placeholder text by paragraphs, sentences or words.

URL Slug Generator

Turn any title into a clean, SEO-friendly URL slug.

CSS Gradient Generator

Design a linear or radial CSS gradient and copy the code.

UUID Generator

Generate random version-4 UUIDs, one or in bulk, in your browser.

Text Diff Checker

Compare two texts and highlight the differences line by line.

CSS Box Shadow Generator

Visually design a CSS box-shadow and copy the code.

HTML Entity Encoder / Decoder

Escape and unescape HTML special characters and entities.

Text to Speech Reader

Read any text aloud with your browser's built-in voices.

Regex Tester

Test and debug regular expressions live, with match highlighting and groups.

Browse all 251 free tools →