Extract Fields from JSON — keep only what matters
Pull just the fields you need out of a JSON document — by path, by name, or in bulk. Drop the noise; keep the signal.
Paste your JSON → Get results instantly (no signup)
→ Keep only the name and age fields from this data.
1{2 "name": "Alice",3 "age": 304}Love the result?
Use this exact pipeline in your app, backend, or LLM workflow.
No setup needed. Works with curl, Node, Python.
Uses example data. For edited input, copy from the playground.
Works with:
- REST and GraphQL API responses
- Deeply nested objects (dot-paths supported)
- Logs and event payloads
- Bulk path lists
Example: input → output
About this tool
Input
{ "user": { "name": "Ada", "email": "ada@example.com" }, "debug": true }
Output
{ "name": "Ada", "email": "ada@example.com" }
Extracting fields from JSON keeps an explicit allowlist of paths and drops everything else. It's the inverse of "remove these noisy keys" — instead of describing what to discard, you describe what to keep, and the rest falls away. For deeply nested API responses, log payloads, or LLM context windows, that's the cheaper mental model: list the 5 fields you actually need and ignore the other 200.
The tool walks the document by path and pulls the requested fields into a compact output. Dot-paths address nested values (user.email), bracket indices reach into arrays (items[0].sku), and bulk patterns let you keep all entries that match a prefix. Missing paths are silently skipped — extracting user.phone from a record that doesn't have one yields nothing for that key, not an error, so partial inputs don't crash the pipeline.
This runs entirely in your browser. Paste the JSON, list the paths, and copy the result. No upload, no signup, no rate limit on payload size beyond browser memory.
How to extract fields from JSON
- Paste your JSON document — an API response, a log line, or anything else — into the input panel.
- List the paths you want to keep, one per line. Use dot-notation for nesting (
user.address.city) and bracket-notation for arrays (items[0]). - Click Run. The output is a trimmed copy of the input with everything outside your list removed.
Common use cases
- Trim API responses down to the few fields your code actually consumes.
- Strip PII from logs before sharing with non-engineers — drop
email,phone,address, keep the rest. - Shrink LLM context payloads to fit a token budget. Pair with JSON for LLMs for token-budget tactics.
- Stage trimmed data for export with the JSON to CSV converter — fewer columns, cleaner spreadsheets.
- Flatten the result with Flatten JSON when downstream tools want flat keys (
user.name). - Hand a trimmed payload to the Clean JSON tool for null-stripping and key sorting.
Path syntax notes
Paths address values inside the document:
name— top-level key.user.email— nested key, dot-separated.items[0]— first element of an array.items[*].sku— everyskuacross the array (bulk pattern).user.address.*— every key underuser.address.
Common errors when extracting fields
- Path typos silently drop the field. Missing paths produce no output for that key. Double-check spelling — extracting
user.firstnamefrom a doc withuser.firstNamereturns nothing. - Arrays vs objects.
items[0]reaches an array element;items.0does not. Use bracket notation for arrays. - Empty result for an entire input. That means none of your paths matched. Verify the input shape with the JSON Diff tool against a known-good record.
Why this tool
- Bulk patterns avoid the "100 paths" mistake when you really mean "everything under
metadata". - Pipeline-native — the output drops straight into the next step without a JSON.parse round-trip.
- Path errors are recoverable, not fatal: missing paths skip silently so partial inputs still produce usable output.
Related tools
Frequently asked questions
What path syntax does this tool use?+−
Dot-notation for nested keys (`user.email`), bracket-notation for array indices (`items[0]`), and `*` wildcards for bulk extraction (`items[*].sku`, `metadata.*`). One path per line.
What happens if a path doesn't match anything in the input?+−
Missing paths are silently skipped — the output simply omits that key. This is intentional: partial or inconsistent records still produce usable output instead of crashing the pipeline.
Can I extract every entry under a parent key?+−
Yes. Use a wildcard: `metadata.*` keeps every direct child of `metadata`; `items[*].sku` pulls every `sku` across an array.
How is this different from `jq`?+−
`jq` is a full programming language for JSON; this tool is a focused allowlist filter. If you just need to keep N fields, listing them is faster and more reviewable than authoring a `jq` expression.
Does the order of paths matter?+−
No. The output preserves the input's original key order, not your listing order. If you need a specific output order, post-process with the Clean JSON tool's key-sort option or rename keys explicitly.
Common next steps
Related tools
- Rename KeysRename known keys or convert key casing without changing the underlying values
- Find & ReplaceFind and replace matching keys or values across JSON using broad search patterns
- FilterFilter rows, items, keys, or values by explicit conditions and keep only the matches you want
- Flatten / NestConvert nested JSON objects, arrays, and API responses into flat key paths or rebuild them using delimiter and casing rules
- RestructureFlexibly restructure collections by grouping, unwinding, transposing, or rearranging nested data
Advanced usage (optional)
Pick Fields
v1.0.0Description
Pick Fields
Keep only specified fields — remove everything else. The inverse of Remove Fields. Select the exact paths you want to keep, and all other fields are stripped. Parent objects of selected paths are preserved automatically.
How It Works
Select fields using the path picker. Only the selected paths (and their parent containers) survive. Everything else is removed. Works on single objects, arrays of objects, and deeply nested structures.
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| Fields to Keep | path-picker | [] | Select the paths to keep. All other fields will be removed. |
Use Cases
Security & Privacy
- Strip sensitive fields: Keep only
nameandemail, removingpassword,ssn, and internal fields - Public API response: Pick only the fields that should be exposed publicly
- Audit logging: Extract only relevant fields for audit records
Data Shaping
- Column selection: Pick specific fields for CSV export or table display
- Nested extraction: Keep
user.nameanduser.address.cityfrom deeply nested objects - Array projection: Pick the same fields from every item in an array
API Response Trimming
- Bandwidth reduction: Keep only needed fields to reduce response size
- Schema conformance: Ensure responses match a specific schema by keeping only defined fields
- Frontend optimization: Pick only the fields the UI actually renders
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Fields to Keep | path-picker | [] | Select the paths to keep. All other fields will be removed. Parent objects of selected paths are preserved automatically. |
Examples
Keep only the name and age fields from this data.1{2 "name": "Alice",3 "age": 304}API Usage
curl -X POST https://your-domain.com/api/v1/utilities/structure.pick-fields \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"name":"Alice","age":30,"password":"secret123","email":"alice@test.com"}},"config":{"paths":["name","age"]}}'1{2 "name": "Alice",3 "age": 304}