JSON Formatter & Validator: Pretty Print, Minify, Fix, Convert
Pricing
from $1.28 / 1,000 json processeds
JSON Formatter & Validator: Pretty Print, Minify, Fix, Convert
JSON formatter and validator: pretty print, minify, validate with exact line and column, repair broken JSON (trailing commas, single quotes, comments), convert JSON to CSV, YAML or JSONL, check against JSON Schema. Bulk, no API key.
Pricing
from $1.28 / 1,000 json processeds
Rating
0.0
(0)
Developer
Data Done Right
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Security
Limited permissionsShare
This JSON formatter and validator pretty prints, minifies, validates and repairs JSON in bulk, and converts it to CSV, YAML or JSON Lines. Paste JSON texts, give links to JSON files or APIs, or point it at an Apify dataset. Every input gets one result row with the status, the exact line and column of any syntax error, a plain-language hint, and the result. No API key, no AI: the same input always gives the same output.
Typical jobs: check a pile of JSON files before an import, fix broken JSON from an LLM or a hand-edited config, pretty print an API response, turn a nested API response into a flat CSV, or test documents against a JSON Schema.
What can this JSON formatter and validator do
- Validate JSON with the exact line, column, character position, error message, the offending line with a caret, and a hint such as "Trailing comma: remove the comma before the closing brace". Duplicate keys are reported as warnings; NaN and Infinity are rejected like a strict parser does.
- JSON Schema validation (draft 2020-12 or draft-07): every error with its JSON path (
$.items[2].price), message and failing keyword. Remote$reflinks are never downloaded. - Pretty print JSON (format) with 1 to 8 spaces or tabs, optional key sorting and optional ASCII-only output.
- Minify JSON to the smallest valid form.
- Fix broken JSON (repair): trailing commas, single quotes, smart quotes, unquoted keys, comments (
//,/* */,#), PythonNone/True/False,undefined/NaN/Infinity, missing commas or colons, raw line breaks inside strings, unescaped inner quotes, invalid backslash escapes, markdown code fences, text before or after the JSON, and truncated JSON (missing closing brackets and braces). The row lists every kind of fix with its count and first position, so nothing changes silently. - JSON to CSV: nested objects flattened with your delimiter (
address.city), arrays as one column per element, joined in one cell, or kept as JSON text; a records path for wrapped data (data.items); semicolon, tab or pipe delimiters; optional spreadsheet-formula protection. - CSV to JSON: delimiter auto-detection, number and boolean detection, and optional rebuilding of nested objects from flattened column names.
- JSON to YAML and JSON to JSON Lines (JSONL / NDJSON). JSONL files can be validated line by line, with the bad lines listed.
- Stats: depth, key count, unique keys, value type counts, longest array and size in bytes.
- Bulk and safe: up to 5,000 documents per run. A bad document or URL never stops the run; it gets its own row with a status and a reason.
- Small results inline, big ones as a file: results up to 20,000 characters (adjustable) are in the row's
resultfield. Larger ones are saved to the key-value store and the row hasresultFile.url, a signed download link that works without an Apify token.
How to validate JSON
- Put your JSON in JSON texts (one per entry) or links in URLs.
- Set Operation to Validate. Optionally paste a JSON Schema.
- Run it.
validis true or false,errorLineanderrorColumnpoint at the problem,hintsays how to fix it, andschemaErrorslists schema violations.
How to fix broken JSON
Set Operation to Repair. The cleaned, pretty printed JSON is in result, and changes shows what was fixed. For Format, Minify and the conversions you can turn on Repair first if the JSON is invalid to get the same behaviour in one step. If the text is beyond repair the row says failed with the reason and is not charged.
How to pretty print or minify JSON
Choose Format / pretty print or Minify. Use Indent, Indent with tabs, Sort keys alphabetically and Escape non-ASCII characters to control the output.
How to convert JSON to CSV
Choose Convert JSON to CSV. An array of objects gives one CSV row per element; an object gives one row. If your data is wrapped ({"data": {"items": [...]}}) set Records path to data.items. To turn a whole Apify dataset into one CSV, pick the dataset and turn on Combine the dataset into one array.
Input example
{"texts": ["{'name': 'Widget', 'tags': ['a', 'b',], 'price': 9.99, 'in_stock': True, 'owner': None,}"],"urls": ["https://api.github.com/repos/apify/crawlee"],"operation": "repair","indent": 2}
More examples:
{"operation": "validate", "jsonSchema": {"type": "object", "required": ["id"]}}: validate against a schema.{"operation": "to_csv", "recordsPath": "data.items", "arrayMode": "join", "csvDelimiter": "semicolon"}: API response to a CSV file.{"operation": "format", "inputFormat": "csv"}: a CSV text or.csvlink to a JSON array.{"operation": "to_yaml", "sortKeys": true}: JSON to YAML.{"datasetId": "<dataset id>", "datasetField": "payload", "operation": "minify"}: minify the JSON text found in a field of every dataset item.
Output
One dataset row per document:
{"index": 1,"source": "{'name': 'Widget', 'tags': ['a', 'b',], 'price': 9.99, 'in_st…","sourceType": "text","operation": "repair","status": "repaired","valid": false,"repaired": true,"inputFormat": "json","error": "Expecting property name enclosed in double quotes","errorLine": 1,"errorColumn": 2,"hint": "Keys must use double quotes. Replace single quotes with double quotes.","changes": ["converted single quotes to double quotes (8x, first at line 1, column 2)","removed trailing commas (2x, first at line 1, column 37)","replaced Python/uppercase True, False, Null with true, false, null (line 1, column 68)","replaced None, undefined, NaN, Infinity with null (line 1, column 83)"],"changeCount": 12,"schemaValid": null,"sizeBytesIn": 88,"sizeBytesOut": 110,"result": "{\n \"name\": \"Widget\",\n \"tags\": [\n \"a\",\n \"b\"\n ],\n \"price\": 9.99, ...}","resultFile": null}
status is ok, repaired, invalid (syntax or schema errors found), failed (download or repair failed) or skipped (empty input, item limit, spending limit). valid always describes the input as you gave it, before any repair. A SUMMARY record in the key-value store lists totals.
How much does it cost
Pay per event: $0.0016 per document processed ($1.60 per 1,000), event json-processed. You pay for each item that returned its result. With the Validate operation, a document found invalid still counts, because the verdict is the result. Failed downloads, empty inputs, text that could not be repaired, invalid input for Format/Minify/convert and skipped items are free. In Combine the dataset mode one event covers 500 dataset items. Use Max items to cap a run.
Limits (honest)
- Repair is a best guess. It fixes the common, unambiguous breakage and reports each fix, but it cannot know what you meant when the text is badly damaged (for example an unescaped quote inside a string next to a comma). Check the
changeslist for important data. A truncated document loses its incomplete last key or value. - Numbers pass through Python floats.
1.10is written as1.1,1E5as100000.0, and numbers with more than about 17 significant digits lose precision. Whole numbers of any size are kept exactly. A number such as1e999cannot be written and is reported as an error. - Duplicate keys: the last value wins (a warning is added).
- JSON Lines input is read as an array of its lines; use to JSONL to write it back. CSV is read with a header row (or generated column names) and no schema; all-digit values with a leading zero stay text.
- Files: up to 100 MB per URL (default 20 MB). Download only from public http(s) addresses; private network addresses and requests needing a login or API key header are not supported. Results over 2 MB are always written as a file.
- YAML output uses the safe dumper; YAML input is not supported.
- JSON Schema: drafts 2020-12 and 07.
formatkeywords (email, date, ...) are annotations only and are not enforced.
FAQ
Why does my JSON fail validation? Run Validate. errorLine, errorColumn, errorContext and hint point at the first problem. The most common causes are trailing commas, single quotes, unquoted keys, comments and a missing closing bracket.
Can it fix JSON from ChatGPT or other LLMs? Yes, that is a typical use. It removes code fences and chatter around the JSON, quotes keys, fixes trailing commas and closes truncated output. It is rule-based, not AI, so it never invents data.
Does it send my data anywhere? No. Everything runs inside the Actor. Only the links you list are downloaded.
Is the repaired result guaranteed to be valid JSON? Yes. If the repair succeeds the output is written by a standard JSON serializer. If nothing sensible can be recovered the row is failed and free.
How large can the output be? Small results are inline. Larger ones go to a file with a signed link (usable without a token); the link stays valid as long as the run's key-value store exists.
Can I process a whole dataset? Yes. Pick it in Dataset with JSON; each item is a document (or use Dataset field). Turn on Combine the dataset to get one CSV, YAML or JSON array for all items.
Related tools
- Excel to JSON - CSV to JSON & XLSX File Reader to turn spreadsheets into JSON rows before you validate them.
- Keyword Extractor: Extract Keywords & Keyphrases from Text for text analysis on the strings inside your JSON.
- Extract Text from PDF: OCR, PDF to Text & Markdown to get text out of documents.
