Guide
What is JSON?
JSON stands for JavaScript Object Notation. It is a lightweight text format used to represent structured data. JSON is easy for humans to read and write and easy for machines to parse and generate, which is why it has become the default format for modern web APIs.
JSON is built from a small set of structures: objects, arrays, strings, numbers, booleans and null. Objects are key value pairs wrapped in curly braces, while arrays are ordered lists wrapped in square brackets.
{
"name": "Travis Interactive",
"tools": ["JSON formatter", "Base64 encoder"],
"active": true,
"visits": 1234
}Where is JSON used?
JSON is used almost everywhere in modern software:
- REST and GraphQL APIs
- Configuration files and feature flags
- Logging and metrics payloads
- Storing data in NoSQL databases
- Client side state in web and mobile apps
JSON syntax basics
- Keys must be quoted strings.
- Strings use double quotes.
- No trailing commas are allowed.
- Numbers are written without quotes, booleans are
trueorfalseand there is a singlenullvalue.
Validating and formatting JSON
Because JSON is strict, small mistakes such as missing quotes or extra commas cause parsing errors. A formatter and validator helps catch these issues quickly and makes JSON easier to read during debugging.
You can use the JSON Formatter and Validator on Travis Interactive to prettify JSON, validate it and produce compact minified output for production use.
JSON and YAML together
YAML is a more human friendly superset of JSON often used for configuration files, for example in Kubernetes manifests. It is common to convert between JSON and YAML depending on which tool or platform you are working with.
If you need to switch between formats, try the JSON ↔ YAML Converter which converts in both directions directly in your browser.