JSON Basics for Beginners (and Related Tools)

Lines of code in a text editor on a computer screen
Photo: β€œCoding Programming” by Sai Kiran Anagani Β· CC0 1.0 Β· via Openverse (stocksnap)

If you work with web apps, you will meet JSON constantly. It is a plain-text format for structured data, designed to be easy for people to read and for machines to parse.

The building blocks

JSON has just six kinds of value: objects in curly braces, arrays in square brackets, strings in double quotes, numbers, true/false and null. Here is a small example:

{"name": "Ada", "age": 36, "skills": ["math", "code"], "active": true}

Rules that trip people up

When something breaks, paste it into the JSON formatter and validator to see the error position and a clean, indented version.

Base64 and URL encoding

JSON can only hold text, so binary data is often stored as Base64. The Base64 tool converts both ways with full Unicode support. When you put data in a web address, special characters must be percent-encoded; the URL encoder does that and can break a link into its parts. Neither is encryption, so never use them to hide secrets.

Identifiers and hashes

Records often need unique IDs. A version 4 UUID from the UUID generator is random and practically collision-free. To check a file download or detect changes, compute a checksum with the hash generator; prefer SHA-256 over MD5 or SHA-1 for anything security-related.

Searching and cleaning with regular expressions

Regular expressions let you describe text patterns. Build them step by step in the regex tester, which highlights matches and capture groups live. Be careful with patterns that can backtrack heavily, and always test with both matching and non-matching examples.

Good practice