JSON Key Extractor

JSON Tools

How to use the JSON Key Extractor

Extract all keys from JSON in seconds:

1

Paste your JSON

Paste any JSON object or array of objects. For arrays, keys are merged across all elements to give you the complete set of possible fields.

2

Choose output format

Flat list gives you one key per line. Dot-path gives you full nested paths like user.address.city. Tree shows the hierarchy with indentation.

3

Set depth limit

Leave depth unlimited to get all nested keys, or set a maximum depth (e.g. 1 for top-level keys only, 2 to include one level of nesting).

4

Copy the key list

Copy all extracted keys to clipboard, or download as a plain text file for documentation or further processing.


When to use this tool

Use this whenever you need to understand, document, or audit a JSON structure:

  • Getting a complete list of all fields in an unfamiliar API response for documentation or analysis
  • Auditing which keys exist in a JSON dataset before building a data processing pipeline
  • Generating a list of database column names or table headers from a JSON export
  • Comparing the key structure of two JSON objects to find fields that exist in one but not the other
  • Building a JSON Schema or TypeScript interface by starting with the extracted field list
  • Checking that all expected fields are present in a JSON response during integration testing
  • Quickly mapping a nested JSON structure before writing JSONPath or jq expressions for it

Frequently asked questions

Q:Does it extract nested keys?
Yes — nested keys are returned as full dot-notation paths. For example, { "user": { "address": { "city": "Paris" } } } produces the key user.address.city in dot-path mode. You can also limit extraction depth if you only want top-level or shallow keys.
Q:How are arrays handled?
For arrays of objects, the extractor merges keys from all objects in the array to give you the complete set of possible fields — even when not every object has all keys. This is useful for sparse arrays where different records may have different optional fields.
Q:Can I get unique keys from an array of objects with different shapes?
Yes — duplicate key paths are deduplicated automatically, so each unique key path appears only once regardless of how many objects in the array contain it. The output is sorted alphabetically for easy scanning.
Q:What is the tree output format?
Tree format displays keys as an indented hierarchy mirroring the JSON structure, making it easy to see parent–child relationships at a glance. It is useful for generating documentation or explaining a JSON structure to someone unfamiliar with it.
Q:Can I use the extracted keys to build a JSON Schema?
Yes — copy the dot-path keys as a starting point, then add types and constraints for each field. The JSON Schema Generator tool on this site can also do this automatically from your JSON, but the key extractor is useful when you want just the field names before deciding on types.