JSON Key Extractor

Recursively scans a JSON document and lists every unique object key it finds, at any nesting depth, one per line, useful for auditing a schema or spotting inconsistent naming. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

Understanding what fields actually exist across a large or inconsistently structured JSON document, an API response with optional fields, a config with many nested sections, means scanning every object by hand unless you have a tool that does it for you.

This tool walks the whole document and surfaces every unique key it finds, giving you a quick inventory of the document's vocabulary.

What Is JSON Key Extractor?

A key extractor that recursively visits every object in a JSON document (including objects nested inside arrays) and collects every property name it encounters into a deduplicated list.

The result is a plain list of key names, one per line, not the values or paths associated with them.

How JSON Key Extractor Works

The tool recursively walks the parsed JSON value: for each object it visits, every property name is added to a Set (which automatically deduplicates), and the walk continues into each property's value and into every array item.

Once the traversal finishes, the Set's contents are printed one key per line in the order they were first encountered.

When To Use JSON Key Extractor

Use it to audit what fields an API actually returns across many sample responses, useful when documentation is out of date or incomplete.

It's also useful for spotting naming inconsistencies, e.g. discovering both userId and user_id appear somewhere in the same document.

Features

Advantages

  • Surfaces every key across the whole document, not just the top level.
  • Automatically deduplicates repeated key names.
  • Fast, single-pass scan with no configuration needed.

Limitations

  • Doesn't show where each key was found or how many times it occurred.
  • Doesn't distinguish keys that happen to share a name but live in unrelated parts of the document.

Examples

Extracting keys from nested data

Input

{"user":{"name":"Ada","address":{"city":"London"}},"active":true}

Output

user
name
address
city
active

Every property name at every nesting depth is listed once, in first-appearance order.

Best Practices & Notes

Best Practices

  • Use Flatten a JSON Object instead if you need to know exactly where each key lives, not just that it exists.
  • Run this against multiple sample documents from the same API to build a fuller picture of all possible fields, since any one sample may omit optional keys.
  • Watch for near-duplicate key names (camelCase vs. snake_case) as a sign of inconsistent data sources.

Developer Notes

Deduplication relies on a native JavaScript Set rather than an array with manual includes() checks, keeping the collection step O(1) per insertion instead of O(n), which matters for documents with a large number of repeated keys across many objects.

JSON Key Extractor Use Cases

  • Auditing which fields an API response actually contains across samples
  • Spotting inconsistent key naming conventions in a dataset
  • Building a quick mental model of an unfamiliar JSON document's shape

Common Mistakes

  • Expecting the extracted list to include key paths or counts; it's just unique names.
  • Assuming every key appears in every object; some may only exist on a subset of records with optional fields.
  • Treating the order of the output as meaningful beyond first appearance; it isn't sorted alphabetically.

Tips

  • Run this on several sample payloads from the same source and diff the results to spot schema drift.
  • Pair with Extract JSON Values if you need the values as well as the key names.

References

Frequently Asked Questions