How to Create and Validate JSON (With Free Browser Tools)
A practical guide to creating a JSON file, fixing unexpected token errors, and validating JSON online—plus when to format, minify, or convert it.
“Create JSON” sounds like a single task. In practice it is three: write a valid file, find the syntax error, and get the data into the next tool (a spreadsheet, an API, or TypeScript).
This guide walks through that path with free browser tools. Nothing here requires an account, and the ToolGenie JSON tools run on your device.
1) Write a valid JSON file
Open the JSON Editor and start from a small object:
{
"name": "Ada",
"active": true,
"tags": ["math", "computing"]
}
Rules that matter:
- Keys and strings use double quotes.
- Fields are separated by commas, with no comma after the last field.
- Objects use
{ }. Arrays use[ ].
If you want a ready-made starting point, copy a sample from JSON Examples and click Open in JSON editor.
2) Validate before you ship it
Click Validate JSON on the editor, or use the dedicated JSON Validator when you only need a syntax report.
A valid result tells you the value is an object, array, or primitive. An invalid result should name the line and column. That is the difference between guessing and fixing.
How to fix “unexpected token”
The parser stopped on a character it did not expect. Check the character before the reported position for:
- a trailing comma (
{"name": "Ada",}) - single quotes (
{'name': 'Ada'}) - an unquoted key (
{name: "Ada"}) - a missing
}or]
Jump to the line, fix that token, and validate again.
3) Format for people, minify for machines
Use the JSON Formatter when you need to read nested data. Two-space indent is the usual default; four spaces is a preference.
Use the JSON Minifier when the payload must be one line—API bodies, environment variables, or compact config.
Formatting and minifying do not change values. They only change whitespace (unless you also sort keys).
4) Convert the same JSON to the next format
Once the file is valid:
- JSON to CSV turns an array of objects into a spreadsheet.
- JSON to TypeScript infers interfaces, including optional fields from mixed arrays.
- The JSON ↔ CSV converter is the bidirectional version if you also need CSV back to JSON.
A 60-second checklist
- Write or paste JSON in the editor.
- Validate and fix the error line.
- Format to review, minify only when you need compact output.
- Download
.json, or convert to CSV / TypeScript.
That is enough to create JSON for free, keep it valid, and move it into the next tool without leaving the browser.
Frequently Asked Questions (FAQ)
Can I create JSON for free?
Yes. You can write JSON in a browser editor, validate it, and download a .json file with no signup. ToolGenie’s JSON editor is built for that.
What does unexpected token mean in JSON?
The parser hit a character it did not expect—often a trailing comma, single quotes, or a missing bracket. A validator that shows the error line is the fastest fix.
Is JSON the same as a JavaScript object?
No. JSON is a stricter text format: double quotes only, no comments, no trailing commas, and no unquoted keys.
Should I format or minify JSON?
Format JSON when you need to read or debug it. Minify JSON when you need a compact API payload or a one-line config value.
What JSON shape converts cleanly to CSV?
An array of objects, where each object is a row. Nested fields can be flattened into columns such as address.city.
Related free tools
Related guides
Browse more guides on the ToolGenie Blog.