How to Format and Validate JSON Without Uploading
By Brevio Team · Last updated: June 12, 2026
JSON is the standard format for API responses, configuration files, and data exchange. Unformatted JSON — a long single-line string — is nearly impossible to read. Formatting it with proper indentation makes the structure clear. But JSON often contains API keys, JWT tokens, database credentials, internal service URLs, and PII. Pasting this into an online formatter that uploads data to a server creates a real security risk. A safer approach: format JSON locally in your browser — nothing leaves your device.
How to Format JSON Without Uploading
- Go to a client-side JSON formatter like brevio JSON Formatter.
- Paste your JSON into the input field. Unformatted, minified, or partially broken JSON all work.
- Click format (or it may format automatically). The tool parses your JSON using the browser's built-in
JSON.parse()and re-serializes it with proper indentation and syntax highlighting. - Review the output. Syntax errors are shown with the line and character position where the problem occurs. Valid JSON will format cleanly.
- Copy the formatted JSON or download it as a file. All formatting happens in-browser — no server request is made.
How to confirm no data is transmitted
You can verify client-side behavior yourself in under a minute using browser DevTools.
- Open DevTools. Press F12 on Windows/Linux, or ⌘⌥I on Mac.
- Go to the Network tab. Filter to Fetch/XHR requests and check “Disable cache” to ensure fresh captures.
- Paste your JSON and click format. Watch the Network tab as the tool processes your input.
- Check the results. On brevio you will see zero POST requests — the tool calls
JSON.parse()inside your browser tab and no network activity occurs. On server-side formatters (JSONFormatter.org, some versions of JSONLint) you will see at least one POST request carrying your payload. That request is your JSON leaving your device.
JSON formatting options — comparison
| Tool | Sends data to server? | Requires install? | Works offline? | Best for |
|---|---|---|---|---|
| brevio JSON Formatter | No | No | Yes | Sensitive/API JSON, quick formatting |
| VS Code (Shift+Alt+F) | No | Yes | Yes | Daily development work |
| jq (CLI) | No | Yes | Yes | Scripting, pipelines, large files |
| Python json.tool | No | No (pre-installed) | Yes | Any Mac/Linux terminal |
| JSONFormatter.org | Yes — server upload | No | No | Public/non-sensitive JSON only |
Why You Shouldn't Paste Sensitive JSON Online
JSON data can contain secrets that expose your infrastructure or users:
- API keys: Credentials for OpenAI, AWS, Stripe, Twilio, and similar services are commonly embedded in JSON config files.
- JWT tokens: Tokens include user IDs, permissions, and claims. Exposing them to a third party creates impersonation risks.
- Database credentials: Connection strings with usernames and passwords appear in JSON config (e.g.,
DATABASE_URLin JSON-formatted env dumps). - PII: User data exports, API responses, and analytics payloads often contain email addresses, names, and phone numbers.
A real example: a developer debugging a Stripe webhook pastes the raw event payload into JSONFormatter.org to read it more easily. That payload contains customer.id, payment_method, and sometimes email. It's now in JSONFormatter.org's server logs. Multiply this by the number of times a day developers format API responses and you have a persistent leak channel.
A client-side formatter processes your JSON with JSON.parse() in your browser tab — no network request is sent, and no server ever sees your data.
How JSON.parse() works as a validator
When JSON.parse() encounters invalid input, it throws a SyntaxError with position information that tells you exactly where the problem is. Understanding how to read these errors saves significant debugging time.
- “Unexpected token ',' at position 45”: Trailing comma after the last property in an object or array. JSON does not allow trailing commas — remove the comma after the final entry.
- “Unexpected token 'a' at position 0”: JSON must start with
{,[,", a number,true,false, ornull. This error usually means the input includes surrounding text — for example, a copy-paste that captured a variable name or log prefix before the JSON. - “Expected property name or '}'”: A key name in the object is missing its surrounding double quotes. JSON requires all keys to be double-quoted strings —
{"key": "value"}not{key: "value"}. - “Unterminated string”: A string value is missing its closing double-quote. This often happens when JSON is truncated mid-copy or when a string value itself contains an unescaped double-quote character.
Formatting vs Minifying JSON
- Pretty-print (format): Adds indentation and newlines. Human-readable. Use for debugging and reading API responses.
- Minify: Removes all whitespace. Smallest possible representation. Use before sending JSON over the network or embedding in source code.
Local Alternatives (No Browser Required)
- VS Code: Paste JSON, press Shift+Alt+F (Windows) or Shift+Option+F (Mac) to format. Change language mode to JSON first if needed.
- Python (pre-installed on Mac/Linux):
No installation required — Python ships with every Mac and most Linux distributions.# From stdin echo '{"key":"value"}' | python3 -m json.tool # From file python3 -m json.tool data.json - jq (CLI):
echo '{"a":1}' | jq .—jqis a powerful command-line JSON processor. Install withbrew install jqon macOS. - Node.js (no packages): Pipe JSON to the following one-liner:
node -e 'process.stdin.resume();let d="";process.stdin.on("data",c=>d+=c);process.stdin.on("end",()=>console.log(JSON.stringify(JSON.parse(d),null,2)));'
Frequently Asked Questions
- Does JSONFormatter.org upload my data?
- Yes. JSONFormatter.org sends your JSON to their servers for formatting. You can verify this yourself in DevTools: paste your JSON, click format, and look for a POST request in the Network tab. For public or non-sensitive JSON this is fine — avoid it for API keys, tokens, or credentials.
- What does “pretty print” mean?
- Pretty printing adds indentation (typically 2 or 4 spaces) and line breaks to make JSON structure readable. The term comes from pretty-printer programs in computer science — the same algorithm has been called “pretty print” since the 1970s.
- Can I format JSON with comments?
- Standard JSON does not support comments. If your JSON has comments (sometimes called JSONC), use VS Code which understands JSONC natively, or strip comments first with a tool like
json-strip-commentsbefore passing to a standard formatter.
For a side-by-side comparison of the most popular JSON formatters and which ones upload your data, see Best JSON Formatters That Don't Upload Your Data. To format JSON directly, use brevio JSON Formatter.
Other ways to do this
You don’t need a web tool for this at all — these options also keep your files on your own machine:
- A text editor like VS Code formats JSON on save and flags syntax errors as you type.
jqpretty-prints and queries JSON from the command line:jq . file.json.- Your browser’s DevTools console parses and inspects JSON with
JSON.parseand the object viewer.
The browser tool is just the no-install, cross-platform option for when you would rather not set any of these up.
Frequently Asked Questions
- How do you format and pretty-print JSON?
- Use a client-side JSON formatter like brevio's JSON Formatter. Paste your JSON, click format, and it beautifies the JSON with indentation and syntax highlighting. No upload happens — everything runs locally in your browser.
- Why is it dangerous to paste JSON into online formatters?
- JSON often contains API keys, JWT tokens, database credentials, internal URLs, and PII. Pasting into a web tool that uploads data to a server sends all of this sensitive information to a third party. Always use a client-side formatter for any JSON with secrets.
- Can you minify JSON in your browser?
- Yes. A client-side JSON formatter can both pretty-print (add indentation) and minify (remove whitespace) JSON. Minification reduces file size, useful when sending JSON over the network or embedding in configuration files.
- How can you validate JSON syntax in your browser?
- Paste your JSON into a client-side validator like brevio's JSON Formatter. If the JSON is invalid, it will show an error message pointing to the line and character where the syntax breaks. Valid JSON will format successfully.
Best JSON Formatters That Don't Upload Your Data (2026)
Why privacy matters when formatting JSON (API keys, tokens, secrets in config), and which formatters process data locally without uploading it.
How to Format SQL Without Uploading It
Most online SQL formatters send your query to a server. This guide shows how to format SQL entirely in your browser — nothing transmitted, DevTools-verified.
How to Format Code Online: JSON, CSS, HTML, SQL (No Upload, No Login)
Why code formatting matters for readability and diffs, how JSON, CSS, HTML, and SQL formatters work, and which tools process code locally without uploading it.
JSON to TypeScript: Generate Interfaces Without Uploading Your Data
How to convert JSON to TypeScript interfaces in your browser. Most online converters send your payload to a server — this guide shows you a client-side alternative.