JSON Formatter & Validator
Make a JSON document easier to read or remove unnecessary spacing. The tool checks syntax before producing output and preserves the original data tokens instead of rebuilding them from JavaScript values.
Format or minify JSON
- Paste JSON or import one UTF-8 text file. The input limit is 1 MiB and the maximum container nesting depth is 64.
- Choose two or four spaces and select Format, or select Minify to remove whitespace outside strings. Invalid input produces an error rather than a repaired document.
- Review the output, then copy it or download a JSON file. Editing the input or changing indentation clears the previous result until you process it again.
What changes and what stays the same
Formatting changes only whitespace outside strings. The formatter uses line feeds, indents nonempty objects and arrays, and puts one space after each object colon. Minifying removes the four whitespace characters allowed by JSON outside strings.
Numbers remain exactly as written. A large integer such as 9007199254740993 is not rounded, and forms such as 1e400, -0 and 1.2300 retain their original spelling. Receiving software may still impose its own numeric limits.
Object members stay in their original order. Repeated names also stay present: syntax validation does not mean that duplicate names are portable or desirable. Different applications can interpret repeated names differently.
Quoted strings and escape sequences remain unchanged. The tool does not sort keys, normalize Unicode, repair syntax, validate a schema or check whether an API will accept your data.
Formatting examples
The input {"ok":true,"items":[1,2]} can be expanded into indented lines without changing any keys, values or array positions. Empty objects and arrays remain compact.
Minifying { "note": "keep two spaces" } produces {"note":"keep two spaces"}. Spaces inside the string are part of its value and stay intact.
The input {"id":9007199254740993,"id":2} keeps both id members and the large integer exactly as written. The valid-syntax label does not certify that duplicate keys are safe for the receiving application.
Syntax validation has limits
Use strict JSON: double-quoted strings, no comments, no trailing commas and no NaN or Infinity literals. Any single top-level JSON value is allowed, including a string, number, boolean or null. JSON5 and multiple JSON Lines records are outside this tool.
Files must be UTF-8 without a byte-order mark. Input is limited to 1 MiB, nesting to 64 containers and output to 8 MiB. Escaped unpaired Unicode surrogates can pass JSON syntax while remaining problematic for other applications. Validation does not establish schema correctness, security or interoperability.
Local processing and sensitive content
The tool processes text locally without tool-added uploads, history or input-bearing links. Copy and download happen only on request. Normal site services remain separate; avoid pasting secrets into a page unless you trust the surrounding environment.
JSON formatting questions
Sources
Related tools
JSON to YAML
Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.
Open tool — JSON to YAMLYAML to JSON
Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.
Open tool — YAML to JSONHTML to Markdown
Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.
Open tool — HTML to MarkdownJavaScript Regex Tester
Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.
Open tool — JavaScript Regex TesterMarkdown to HTML
Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.
Open tool — Markdown to HTMLText Sorter
Sort lines alphabetically by a chosen language or by Unicode code point, keeping duplicates, blank rows and complete line contents.
Open tool — Text SorterRemove Duplicate Lines
Keep the first copy of each exact text line, preserving order, significant spaces and blank rows, then copy or download the result.
Open tool — Remove Duplicate LinesText Diff Checker
Compare two drafts locally, with exact whole-line changes, visible whitespace rules and clear final-newline handling.
Open tool — Text Diff CheckerCase Converter
Convert text to uppercase, lowercase, capitalized words or sentence case with explicit letter rules.
Open tool — Case ConverterHTML Entity Encoder/Decoder
Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.
Open tool — HTML Entity Encoder/DecoderMarkdown Table Generator
Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.
Open tool — Markdown Table GeneratorQuery String Parser & Builder
Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.
Open tool — Query String Parser & BuilderURL Encoder & Decoder
Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.
Open tool — URL Encoder & DecoderBase64 Encoder & Decoder
Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.
Open tool — Base64 Encoder & DecoderXML Formatter
Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.
Open tool — XML FormatterSMS Character Counter & Segment Calculator
See how your message is encoded, where its segments end and what it may cost. Your text stays in your browser.
Open tool — SMS Character Counter & Segment CalculatorSocial Media Character Counter
Check platform-specific limits and split posts without losing text.
Open tool — Social Media Character CounterCharacter Counter
Count characters, words, sentences and paragraphs. Check word density, reading time and UTF-8 size, all in your browser.
Open tool — Character CounterText Size Calculator
Compare text encodings and payload sizes in your browser.
Open tool — Text Size CalculatorPDF Text Cleaner
Fix line breaks and spacing in text copied from a PDF. Preserve your original and review ambiguous hyphens before copying the cleaned text.
Open tool — PDF Text CleanerFancy Text Converter
Convert supported fancy Unicode letters to normal text locally. Keep case, accents, emoji and your original text.
Open tool — Fancy Text ConverterGarbled Text Fixer
Fix garbled text and repair broken accents with a browser-based mojibake fixer. Review each possible UTF-8 reversal before applying it.
Open tool — Garbled Text FixerGmail Clipping Checker
Measure email HTML bytes in UTF-8, compare them with an advisory 102,000-byte Gmail reference, and inspect size contributors locally.
Open tool — Gmail Clipping Checker