Skip to content
LocalOnly

The LocalOnly Blog

Practical, in-depth guides for every tool in the toolkit - the how, the why, and the best practices. Written for developers, and 100% aligned with our privacy-first approach: everything runs in your browser.

JSON Tools

Browse tools
JSON Tools4 min read

How to Format JSON Files Automatically with Prettier

Two formatters can disagree about the same JSON file. Here is how a team picks one, applies it in every editor and before every commit, and makes CI enforce it.

Read guideJSON Formatter
JSON Tools4 min read

Minified vs Pretty JSON: When Minifying Matters

Whitespace in JSON is nearly free once gzip runs. Here is where JSON travels without compression, with the extra bytes measured on sample payloads.

Read guideJSON Minifier
JSON Tools4 min read

JSON with Comments: JSON vs JSONC vs JSON5 Explained

The same file opens cleanly in VS Code and is rejected by npm. The difference is which of three JSON dialects each tool reads.

Read guideJSON Validator
JSON Tools4 min read

Pretty Print JSON in the Terminal, Python and Node.js

Four ways to make JSON readable without leaving your terminal or browser, and the three edge cases where pretty printing changes the data.

Read guideJSON Beautifier
JSON Tools3 min read

JSON Key Order: Why It Changes and How to Sort JSON Keys

The same data can be written with its keys in a different order in each language, and sometimes on each run. Here is where the order comes from, and the fix for each case.

Read guideJSON Sort Keys
JSON Tools3 min read

How to Flatten Nested JSON in JavaScript and Python

A recursive function of about ten lines flattens any JSON document into path keys. Here it is for JavaScript and Python, with the choices that decide whether you can rebuild the original.

Read guideJSON Flattener
JSON Tools3 min read

How to Unflatten JSON: Dot Notation to Nested Objects

Turning user.address.city back into nested objects takes about fifteen lines. Here is a version that builds arrays, fails clearly on conflicting keys and ignores __proto__.

Read guideJSON Unflattener
JSON Tools4 min read

How to Escape JSON for HTML, SQL, Shell Commands and CSV

JSON escaping makes text safe inside JSON. Putting the JSON somewhere else needs that place's own escaping too. Here are the five places it goes wrong most often.

Read guideJSON Escape
JSON Tools3 min read

How to Unescape JSON Strings in Logs with jq

When a log line holds an object as an escaped string, you cannot search it by field. Here is how to read it today with jq, and the one-line change that stops it.

Read guideJSON Unescape
JSON Tools4 min read

JSON.stringify Explained: undefined, Dates and BigInt

Most surprises from JSON.stringify are silent: a field disappears, a Map becomes {}, a date turns into a string. Here is exactly what happens to each kind of value, and how to control it.

Read guideJSON Stringify
JSON Tools3 min read

Remove Null Values from JSON in JavaScript and Python

A JSON.stringify replacer removes most nulls but not all of them. Here is a tested recursive function for JavaScript and Python, and the one case where removing nulls breaks things.

Read guideRemove Nulls from JSON
JSON Tools4 min read

Empty Array vs Null vs Missing Field in JSON APIs

Leaving out empty arrays saves a few bytes and costs every client a defensive check. Here is how to decide what an API should return, and how to write it into the contract.

Read guideRemove Empty Values from JSON
JSON Tools4 min read

How to Compare Two JSON Objects in JavaScript and Python

JSON.stringify(a) === JSON.stringify(b) fails as soon as key order differs. Here is how to check equality properly in JavaScript and Python, and how to list exactly what changed.

Read guideJSON Compare & Diff
JSON Tools3 min read

How to Deep Merge JSON Objects in JavaScript and Python

The built-in ways to combine objects lose nested settings. Here is a short, tested deep merge for JavaScript and Python, and how to handle arrays, null and __proto__.

Read guideJSON Merge
JSON Tools4 min read

How to Open Large JSON Files Without Crashing Your Editor

Loading a 121 MB JSON file took over a gigabyte of memory in jq. Streaming the same file took 3 MB. Here is how to explore large JSON without loading it all at once.

Read guideJSON Tree Viewer
JSON Tools3 min read

How to Measure JSON Size: Characters, Bytes and Gzip

A payload can be 19,847 characters, 20,197 bytes and 1,803 bytes on the wire, all at once. Here is which number an API limit, a database or a browser actually checks.

Read guideJSON Statistics
JSON Tools3 min read

JSONPath vs jq vs JMESPath: Syntax Compared with Examples

Three query languages for JSON look alike and behave differently. Here are ten everyday queries in all three, with the results they actually return.

Read guideJSONPath Evaluator
JSON Tools3 min read

JSON Schema to TypeScript and Pydantic: Generate Types

A JSON Schema can generate the types your code uses, so the contract and the code cannot drift apart. Here is the output of two common generators, tested on one schema.

Read guideJSON Schema Generator
JSON Tools3 min read

How to Validate JSON Request Bodies with JSON Schema

Checking a request body against a JSON Schema replaces dozens of hand-written if statements. Here is a tested setup for Node and Python, and a 400 response that tells the client exactly what to fix.

Read guideJSON Schema Validator

Converters

Browse tools
Converters3 min read

JSON vs YAML for Config Files: Which Should You Use?

YAML is easier to read and easier to get wrong. Here is what each format gives you for configuration, the mistakes YAML lets through, and a rule for choosing.

Read guideJSON to YAML Converter
Converters3 min read

How to Convert YAML to JSON in JavaScript (Node.js)

Two lines of code convert YAML to JSON, and the parser's defaults decide whether merge keys apply, dates stay strings and no means false. Here are the options that matter, tested.

Read guideYAML to JSON Converter
Converters3 min read

How to Convert JSON to CSV in JavaScript and Python

Joining values with commas breaks on the first name that contains one. Here is a short, tested JSON to CSV converter for JavaScript and Python, and the details that make Excel open it correctly.

Read guideJSON to CSV Converter
Converters3 min read

How to Convert CSV to JSON in JavaScript and Python

A single quoted comma breaks the split approach. Here is correct CSV parsing in Python and JavaScript, the byte order mark that renames your first column, and safe type conversion.

Read guideCSV to JSON Converter
Converters3 min read

How to Convert JSON to XML in JavaScript and Python

A library escapes the text for you, but it will happily write XML that is not valid. Here is tested JSON to XML code for Node and Python, and the three inputs that break it.

Read guideJSON to XML Converter
Converters3 min read

How to Convert XML to JSON in JavaScript and Python

A default XML parser drops attributes, turns 007 into 7 and returns an object or an array depending on how many items there are. Here are the settings that fix all three.

Read guideXML to JSON Converter

Developer Utilities

Browse tools
Developer Utilities3 min read

How to Generate a UUID in JavaScript, Python and SQL

Every modern runtime can generate a UUID without a library. Here are the one-liners for JavaScript, Python and PostgreSQL, a tested UUID v7 function, and two common mistakes.

Read guideUUID Generator
Developer Utilities3 min read

Nano ID vs UUID vs Auto-Increment IDs Compared

Every new table and every public URL needs an ID scheme. Here is how Nano ID, UUID and auto-increment compare, with the collision maths worked out and a tested Nano ID function.

Read guideNano ID Generator
Developer Utilities2 min read

What Is Base64 Used For? Data URIs, Auth, JWT, Email

Base64 turns bytes into plain text so they can travel where only text is allowed. Here are the five places developers meet it most, with real examples, and the cases where it is the wrong tool.

Read guideBase64 Encode
Developer Utilities2 min read

Decode Base64 in the Terminal, JavaScript and Python

Decoding Base64 is one call in every language, and each call has a trap: atob garbles accents, Buffer accepts junk, and Python rejects missing padding. Here is the correct version of each.

Read guideBase64 Decode
Developer Utilities3 min read

How to Verify a JWT in Node.js and Python

Decoding a JWT shows its claims; verifying it proves they are genuine. Here are the checks a correct verification makes, written out in Node.js and Python so you can see each step.

Read guideJWT Decoder
Developer Utilities2 min read

URL Encoding Characters: What to Encode and Where

The same character can be fine in one part of a URL and break another. Here is a reference table of what each JavaScript and Python function does with the characters that matter.

Read guideURL Encoder
Developer Utilities2 min read

How to Decode a URL Parameter That Contains Another URL

Tracking links and login redirects nest one URL inside another, encoded once per layer. Here is how to unwrap them correctly in JavaScript and Python, and the redirect check that keeps it safe.

Read guideURL Decoder
Developer Utilities2 min read

Check a File's SHA-256 Hash on Mac, Linux and Windows

A published SHA-256 checksum only helps if you compare it. Here are the exact commands for each operating system, a one-step check against a checksum file, and code for Node.js and Python.

Read guideHash Generator
Developer Utilities3 min read

NIST Password Guidelines: The Rules to Use in Your App

NIST's guidance dropped the rules most sign-up forms still enforce. Here is what it recommends instead, why length beats symbols in numbers, and how to generate passwords securely in code.

Read guidePassword Generator
Developer Utilities3 min read

Unix Timestamp vs ISO 8601: How to Store Dates

JSON has no date type, so every API picks a format for dates. Here is how Unix timestamps and ISO 8601 strings compare, the bugs each one invites, and what to use where.

Read guideUnix Timestamp Converter
Developer Utilities3 min read

Lorem Ipsum Alternatives: Realistic Test Text

Lorem ipsum has short, even words, so it hides the layout bugs real content exposes. Here is a set of test strings worth keeping next to it, and the CSS that keeps them from breaking a layout.

Read guideLorem Ipsum Generator
Developer Utilities3 min read

PlantUML vs Mermaid: Which Diagram Tool Should You Use?

Both turn plain text into diagrams, and both are free. They differ in which diagrams they draw well, where they render without extra setup, and where your diagram source goes. Here is how to choose.

Read guidePlantUML Editor

Command Palette

Search for a tool or command