MakeMyTxt

JSON Formatter

Paste JSON to pretty-print, minify, or validate it. Errors point to the exact position in your input.

Mode

Indent

How to use: pretty-print and validate JSON with MakeMyTxt

Paste any JSON payload to pretty-print or minify it, with inline error positions when the input is malformed.

  1. 1

    Open the JSON Formatter

    Go to makemytxt.com/json-formatter — the page is static, loads instantly, and works offline after the first visit.

  2. 2

    Paste your JSON

    Drop in an API response, a config file, or any JSON snippet. Parsing runs in your browser using the native JSON.parse — nothing is uploaded.

  3. 3

    Choose pretty-print or minify

    Pretty-print with two or four-space indentation makes JSON readable for code review. Minify strips all whitespace so the payload is as small as possible for storage or transport.

  4. 4

    Copy, download, or fix errors

    If the JSON is invalid, the line and column of the failure are reported so you can jump straight to the broken quote or missing comma. Otherwise copy the output or download it as a .json file.

Frequently asked questions

Does the formatter send my JSON anywhere?
No. Everything happens in your browser using the built-in JSON.parse and JSON.stringify. Your data never leaves your device, which is important for production API responses and anything covered by an NDA.
Why do I get a "position N" error?
JavaScript JSON.parse reports the byte offset where parsing failed. The formatter converts that offset to a line and column so you can find the error quickly. Common culprits are trailing commas, single quotes, and unescaped control characters — all of which are invalid in strict JSON.
Can it handle JSON with comments or trailing commas?
No — the tool follows the strict JSON standard (RFC 8259). If you are working with JSON5 or JSONC, strip the comments and trailing commas first, or use a language-specific parser that accepts the relaxed syntax.
How big of a JSON file can I format?
In practice anything under a few megabytes formats instantly. Much larger payloads will still work but may briefly freeze the tab during parse. For multi-gigabyte logs, use a streaming parser like jq on the command line instead.

Related tools