JSON Keys Extractor|Options
Input
e.g. {"user": {"name": "Alice", "address": {"city": "NYC"}}}
Output
e.g. user name address city
Valid JSON: No
Keys found: 0

JSON Keys Extractor Online — Flat, By-Level & Namespaced Key Extraction

Need to quickly discover every attribute path inside a JSON object? This free tool parses your JSON and extracts keys in three modes: flatten all keys into a simple list, limit extraction by depth level, or generate fully namespaced paths like user_address_city. Configure the separator character, control how array indices appear in paths, and deduplicate across branches — all in your browser.

How to Use This Tool

  1. Paste your JSONPaste a JSON object or array into the input panel. The tool accepts any valid JSON — objects, arrays, or even primitives.
  2. Choose extraction modeSelect "Flatten all" for every key at every depth, "By level" to limit to a specific depth, or "Namespaced" to generate full dot-path-style keys like user_address_city.
  3. Configure namespaced optionsIn namespaced mode, set the separator character (underscore, dot, slash, etc.), choose how array indices appear (none, zero-based, or one-based), and set a max depth limit.
  4. Toggle deduplicationEnable "Dedup" to remove duplicate keys or paths found across objects inside arrays, or disable it to see every occurrence.
  5. Copy the resultThe extracted keys appear instantly in the output panel. Click Copy to use them in your code, config files, or documentation.
  6. Chain with other toolsWith Auto-fill enabled, your output automatically carries over when you open another tool from the sidebar. Use the back and forward arrows to navigate between tools with full state restoration.

Features

Namespaced Path Extraction

Generate fully qualified key paths like user_address_city or config.database.host. Only leaf values are emitted — intermediate object keys are folded into the path.

Configurable Separator

Choose any separator character for namespaced paths: underscore (_), dot (.), slash (/), arrow (->), or any custom string.

Array Index Control

In namespaced mode, choose how arrays appear in paths: skip the array level entirely, include zero-based indices (items_0_name), or one-based indices (items_1_name).

Depth-Limited Extraction

Use "By level" or set max depth in namespaced mode to control how deep the tool traverses. Level 1 for top-level keys only, higher levels for deeper structures.

Global Key Deduplication

Deduplication works across all branches — not just within arrays. Identical keys or paths from different parts of the JSON are merged into a unique list.

Complete Privacy

All processing runs in your browser. Your JSON data never leaves your device — no server requests, no storage.

Real-World Use Cases

1

Flatten config files for environment variables

Convert nested JSON config like {"db": {"host": "localhost"}} into flat namespaced keys (db_host) that map directly to environment variable names.

2

Discover API response schemas

Paste a JSON API response and extract all namespaced paths to understand the full data structure without reading through deeply nested objects.

3

Generate TypeScript interfaces

Extract flat or namespaced keys from a JSON payload as a starting point for writing TypeScript type definitions, interfaces, or Zod schemas.

4

Build translation key inventories

Extract namespaced paths from i18n JSON files to audit translation coverage, find missing keys, or generate key lists for translators.

5

Database column discovery from JSON exports

When working with JSON columns or document database exports, extract all unique field paths to discover the schema and plan relational table structures.

Frequently Asked Questions

What is namespaced mode?
Namespaced mode builds full key paths by joining nested key names with a separator. For example, {"user": {"address": {"city": "NYC"}}} becomes user_address_city. Only leaf values (primitives, null) produce a path — intermediate object keys are not emitted separately.
How does the tool handle arrays in namespaced mode?
You have three options: (1) None — skip the array level entirely, so items[0].name becomes items_name. (2) Zero-based — include 0-based indices like items_0_name. (3) One-based — include 1-based indices like items_1_name.
What separator should I use?
Underscore (_) works well for environment variables and flat config. Dot (.) matches JavaScript object notation. Slash (/) is common for file paths or REST-style keys. You can use any string as the separator.
What does the dedup option do?
Dedup removes duplicate keys or paths from the output. In flat mode, {"a":{"x":1},"b":{"x":2}} with dedup returns x once instead of twice. In namespaced mode with array index=none, identical paths from different array elements are merged.
What does max depth control?
Max depth limits how deep the tool traverses. In by-level mode, level 1 = top-level keys only. In namespaced mode, when the depth limit is reached, the accumulated path so far is emitted as a leaf.
Can I extract keys from a JSON array of objects?
Yes. If your input is an array like [{"name":"Alice"}, {"name":"Bob","age":30}], the tool extracts keys from each object. With dedup on, the result is: name, age.
Is my JSON data sent to a server?
No. All processing happens entirely in your browser using JavaScript. Your data is never transmitted or stored anywhere.

Related Tools

All text processing happens directly in your browser. Your text is never sent to any server, stored, or shared with third parties. This tool is completely private and secure.