Need a bit of JSON to paste into a test, a mock API or a tutorial? The snippets below are grouped by shape, from a flat user profile to an order with nested items and a paginated API reply. Every one is valid under RFC 8259, and each card has a Copy button, a Download button and shortcuts to open the sample in one of our tools.
Looking for Detailed Explanations? Check out ourJSON samples article with use cases and longer examples.
How to Use These Samples
Copy or Download
Copy puts the exact text of a sample on your clipboard, ready for a request body in Postman, a fixture file or a unit test. Download saves the same text as a .json file named after the sample.
Try in Our Tools
The two buttons under each sample copy it and open the tool in a new tab. Paste it into the editor there:
- •JSON Formatter - re-indent, minify or sort the sample
- •JSON to Table - see the sample as a table you can filter and sort
Filter by Category
The category buttons at the top narrow the list to one shape: Basic, Arrays, Nested (see JSON object syntax), API, Specialized, Social or Config.
Frequently Asked Questions
Which sample should I start with?
Pick by shape rather than by topic. Basic holds flat objects with strings, numbers and booleans. Arrays wraps a list of records in an object, which is how most APIs send lists. Nested shows objects inside objects and lists inside those. API covers a success reply, an error reply and a paginated list. Specialized, Social and Config are larger mixed documents for when you want something closer to real data.
Is every snippet really valid JSON?
Yes. Each one parses with a strict reader such as Python's json module or JSON.parse, with no comments, trailing commas or single quotes. Copy puts exactly the text you see on your clipboard, and Download saves the same characters as a .json file.
What happens when I click Try in Formatter or Try in Table?
The sample is copied to your clipboard and the tool opens in a new tab with an empty editor. Press Ctrl+V (Cmd+V on a Mac) there. A short note under the sample tells you whether the copy worked; if your browser blocked it, select the JSON and copy it by hand.
Why are zip codes and phone numbers strings and not numbers?
Because they are labels, not amounts. A Boston zip code like 02101 would lose its leading zero as a number, and a phone number has dashes and a plus sign. The samples keep them in quotes, which is what you should do in your own data too. Prices such as 15.00 are written as numbers, so most parsers will read them back as 15.
Can I test long IDs with these samples?
The IDs here are small on purpose. If you need to test something like an ICCID, 8901240544102066246 is a good value to add: JSON.parse in JavaScript turns it into 8901240544102066000 because it has more digits than a double can hold. Send such IDs as strings, or use a parser that keeps big integers. JSON to Table on this site shows them with every digit.
Does copying or downloading send anything to a server?
No. The samples are part of this page, and copying, downloading and filtering all happen in your browser. Nothing is uploaded and nothing you do here is kept.