npmstart.
Exercises
中文

Inspect and format JSON with IT-Tools

Use fictional subscriptions to understand indentation, arrays, types and syntax errors.

IT-ToolsReviewed 2026-11-10Original example exercise

What you will make

Readable JSON that parses again, with changes you can explain.

Before you begin
A browser and sample-data.json. No real customer records are needed.

Menu names can change. The upstream demo is externally operated and may differ from the pinned local version.

Understand the shape before formatting

Open the fictional sample in a text editor. Its outer object holds currency and a subscriptions array; each entry has a name, monthly price and enabled flag. Count the entries and distinguish numbers from strings and booleans. Formatting improves readability. It does not verify whether the prices are correct or whether the records make business sense.

Format the input in the JSON tool

Search IT-Tools for JSON and open its formatting tool. Paste the sample and select readable indentation. Compare field names, array order and values against the original. Tool labels can differ across versions; choose formatting or validation, not a conversion into another data format. Keep the original tab open while checking the output.

Separate syntax from meaning

Remove one comma in a copy, observe the parse error, then restore it. Next change a numeric 12 to the string "12". The document can still be valid JSON while its amount type is wrong for your application. JSON uses double-quoted keys and strings; JavaScript comments and trailing commas do not belong in it. Change one thing at a time so you can explain each result.

Save the result and reopen it

Save the formatted output as a new UTF-8 .json file rather than overwriting your only source. Reopen it, check character display and confirm the outer structure and record count. Before feeding it to an application, check required fields, allowed values and price units against that application’s contract. Parsing successfully is a useful first check, not complete validation.

Choose an appropriate environment

The sample contains no credentials or customer records. For real data, examine the behavior of the chosen tool and deployment: running in a browser does not automatically mean fully offline. A local copy lets you inspect pinned source and requests, but does not replace your data-handling rules. Use a redacted copy when you cannot establish the relevant boundary.

Check your result

  • Record counts and values match before and after formatting.
  • You can distinguish valid JSON from valid application data.
  • The saved file parses on a second pass.

The pasted text will not parse?

Inspect quotes, commas and brackets near the first error. Repair a copy locally rather than globally replacing punctuation.

Sources and further reading

This exercise is original. Consult these primary sources for project behavior and syntax.