Filter (Free Online Tool)
Filter rows, items, keys, or values by explicit conditions and keep only the matches you want
Paste your JSON → Get results instantly (no signup)
→ Filter this data down to the items I need and filter active users.
1{2 "users": [3 {4 "name": "Alice",5 "active": true6 },7 {8 "name": "Charlie",9 "active": true10 }11 ]12}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:
- API responses
- Nested JSON
- Arrays & objects
Example: input → output
{ "users": [ { "name": "Alice", "active": true }, { "name": "Bob", "active": false }, { "name": "Charlie", "active": true } ]}{ "users": [ { "name": "Alice", "active": true }, { "name": "Charlie", "active": true } ]}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
- Flatten / NestConvert nested objects to flat key paths or rebuild them using delimiter and casing rules
- Pick FieldsKeep only a known allowlist of fields and remove everything else
- RestructureFlexibly restructure collections by grouping, unwinding, transposing, or rearranging nested data
Advanced usage (optional)
Filter
v1.0.0Description
Filter
Filter JSON data by key name, value text, or JavaScript expression. Removes non-matching items and preserves the structure of matching ones.
Filter Types
Key Filter (key)
Keeps object entries whose key name contains the search text. Searches recursively through all nesting levels.
Value Filter (value)
Keeps entries whose primitive values (strings, numbers, booleans) contain the search text. Objects and arrays are kept if any descendant value matches.
JavaScript Filter (javascript)
Evaluates a JavaScript expression against each array element. The expression receives two variables:
item— the current array elementindex— the element's index (0-based)
The expression must return a truthy value to keep the item.
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| Filter Type | enum | value | key, value, or javascript |
| Expression | string | (required) | Search text or JS expression |
| Case Sensitive | boolean | false | Case sensitivity for key/value modes |
Use Cases
Data Extraction
- Active records:
item.active === true— extract only active users/items - By status:
item.status === "published"— get published articles - Age range:
item.age >= 18 && item.age <= 65— filter by numeric range - Date range:
new Date(item.createdAt) > new Date("2024-01-01")— filter by date - Non-empty:
item.name !== "" && item.name !== null— skip empty entries - Has property:
item.email !== undefined— only items with email field
Data Cleanup
- Remove nulls:
item !== null— strip null entries from arrays - Remove empty strings:
item !== ""— strip blank entries - Remove test data:
!item.name.startsWith("test_")— exclude test records - Remove duplicates by field:
index === 0 || item.id !== arr[index-1].id— deduplicate
Search & Discovery
- Find by key: Key filter with
password— find all password-related fields - Find by value: Value filter with
error— locate error messages - Find by pattern:
item.email.endsWith("@company.com")— company emails only - Contains text:
JSON.stringify(item).includes("deprecated")— deep text search
Log Analysis
- Error logs: Value filter with
error— extract error entries - By severity:
item.level === "error" || item.level === "warn"— errors and warnings - By service:
item.service === "auth"— filter by service name - Recent entries:
Date.now() - new Date(item.timestamp) < 86400000— last 24 hours
JavaScript Expression Tips
Comparison Operators
item.age > 18 // greater than
item.status === "active" // strict equality
item.score >= 80 && item.score <= 100 // range
item.role !== "admin" // not equalString Methods
item.name.includes("Alice") // contains text
item.email.endsWith("@test.com") // ends with
item.code.startsWith("ERR_") // starts with
item.name.length > 3 // string length
item.tag.match(/v\d+/) // regex matchType Checks
typeof item === "string" // only strings
typeof item.age === "number" // has numeric age
Array.isArray(item.tags) // has tags array
item !== null && item !== undefined // non-nullCombining Conditions
item.active && item.age >= 18 // AND
item.role === "admin" || item.role === "editor" // OR
!(item.deleted || item.archived) // NOTWorking with Nested Data
item.address && item.address.city === "London" // nested property
(item.tags || []).includes("featured") // safe array check
Object.keys(item).length > 3 // object sizeExamples
Filter Active Users
Input:
{
"users": [
{ "name": "Alice", "active": true },
{ "name": "Bob", "active": false },
{ "name": "Charlie", "active": true }
]
}Config: filterType: javascript, expression: item.active === true
Output:
{
"users": [
{ "name": "Alice", "active": true },
{ "name": "Charlie", "active": true }
]
}Filter by Age Range
Input:
[
{ "name": "Alice", "age": 30 },
{ "name": "Bob", "age": 16 },
{ "name": "Charlie", "age": 25 }
]Config: filterType: javascript, expression: item.age >= 18
Output:
[
{ "name": "Alice", "age": 30 },
{ "name": "Charlie", "age": 25 }
]Keep Only Error Logs
Input:
{
"logs": [
{ "level": "info", "message": "Server started" },
{ "level": "error", "message": "Connection refused" },
{ "level": "info", "message": "Request processed" },
{ "level": "error", "message": "Timeout exceeded" }
]
}Config: filterType: value, expression: error
Output:
{
"logs": [
{ "level": "error", "message": "Connection refused" },
{ "level": "error", "message": "Timeout exceeded" }
]
}Keep Only Name Fields
Input:
{
"name": "Alice",
"age": 30,
"email": "alice@test.com",
"address": "123 Main St"
}Config: filterType: key, expression: name
Output:
{
"name": "Alice"
}Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Filter Type | enum | value | key: keep entries whose key contains the expression. value: keep entries whose value contains the expression. javascript: keep array items where the JS expression is truthy.
key value javascript |
| Expression | string | (required) | For key/value mode: text to search for. For javascript mode: a JS expression using item and index (e.g. item.active === true, item.age >= 18, item.name.includes("Alice")). |
| Case Sensitive | boolean | false | Only applies to key and value filter types |
Examples
Filter this data down to the items I need and filter active users.1{2 "users": [3 {4 "name": "Alice",5 "active": true6 },7 {8 "name": "Charlie",9 "active": true10 }11 ]12}API Usage
curl -X POST https://your-domain.com/api/v1/utilities/structure.filter \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"users":[{"name":"Alice","active":true},{"name":"Bob","active":false},{"name":"Charlie","active":true}]}},"config":{"filterType":"javascript","expression":"item.active === true","caseSensitive":false}}'1{2 "users": [3 {4 "name": "Alice",5 "active": true6 },7 {8 "name": "Charlie",9 "active": true10 }11 ]12}