← All blog posts

JSON Formatter for homeowners and DIYers

WhiteUI · A plain-English guide to the JSON Formatter

Homeowners and DIYers do not only work with timber and paint: many also keep household numbers in plain text, such as a monthly budget, a list of rooms to paint, or the settings of a smart plug. JSON is a tidy way to write those numbers down, one named value per line, and the JSON Formatter lays the block out neatly or squeezes it down, so the same numbers work in a document and in a single-line field.

At a glance

Electricity: 53% of the month₹1,240 electricity₹1,119 water + internetTotal ₹2,359 for November
Electricity at 1,240 rupees is 53 percent of the November total of 2,359 rupees, with water and internet making up the other 1,119 rupees.

A monthly budget, formatted

Take a November budget: {"month": "November", "electricity": 1240, "water": 320, "internet": 799}. It is 73 characters as pasted, and it has four keys: month, electricity, water and internet. In Pretty mode it becomes 83 characters across 6 lines, with each bill on its own line, and in Compact mode it becomes 66 characters on one line. The three bills add up to 2,359 rupees: 1,240 for electricity, 320 for water, and 799 for internet. Electricity is the biggest share, about 53 percent of the month, and that is easy to see in the Pretty version, because each bill sits on its own line.

Reading the Pretty version

The Pretty version puts each bill on its own line, two spaces in, so the eye can compare them without hunting through a single line of text. Electricity reads 1240, water reads 320, and internet reads 799, and the biggest number stands out at once. That is the version to paste into a document, a message to a partner, or a note to yourself, because a person will read it. The month itself, "November", is text, so it sits in double quotes, while the three amounts are numbers, so they stand without quotes, and formatting keeps that difference visible.

The Compact version for storage

The Compact version is the same budget in 66 characters on one line, with no spaces after the colons or commas. That is the version to paste into a single-line field, such as a settings box or a spreadsheet cell, where line breaks would be lost or would split the value across rows. The data is identical: the same four keys, the same three amounts, the same total of 2,359 rupees. Only the layout changes, and the tool switches between the two with one click, so there is no need to retype anything.

A second example: smart-home settings

Try a settings object for a smart plug or a thermostat: {"theme": "dark", "font_size": 14, "notifications": true}. It is 57 characters as pasted, with three keys. In Pretty mode it becomes 65 characters across 5 lines, one line per setting, and in Compact mode it becomes 52 characters on one line. Settings like these are often copied from a manual or a forum post, and they are often pasted with a trailing comma or a single quote by mistake. Formatting them first shows whether the text is valid, and the error message names the exact position if it is not.

Copying the result into a spreadsheet

The Compact version pastes cleanly into a single spreadsheet cell, because it has no line breaks, while the Pretty version pastes across six rows, one line per row, which suits a sheet where each bill gets its own row. Pick the mode that matches the destination: one cell means Compact, one row per bill means Pretty. Either way, the numbers stay the same, and the total stays 2,359 rupees.

The common mistake

People edit the Pretty output by hand, to change a bill from 1240 to 1300, say, and drop a comma while doing it, so the block stops being valid JSON. The safer way is to edit the original block, or the Compact version, and then paste it back into the tool and format it again. The tool checks validity every time, so a dropped comma is caught at once, with the error naming the position, instead of sitting unnoticed in a document until someone tries to use the numbers.

Frequently asked questions

What does a monthly budget look like in JSON?

{"month": "November", "electricity": 1240, "water": 320, "internet": 799}: 73 characters in, 83 in Pretty across 6 lines, and 66 in Compact, totalling 2,359 rupees.

Which mode should I paste into a spreadsheet cell?

Compact, because it has no line breaks and fits in one cell. Pretty pastes across six rows, which suits a sheet where each bill gets its own row.

What is the biggest bill in the November budget?

Electricity at 1,240 rupees, about 53 percent of the 2,359-rupee total, with water at 320 and internet at 799.

Why format settings before I paste them somewhere?

Because formatting checks validity at the same time. A trailing comma or a single quote is caught at once, with the error naming the exact position.

More guides on the JSON Formatter

Try it yourself

Try the JSON Formatter — free, in your browser.

Open the JSON Formatter