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)

⚡ Instant resultsNo signupRuns in your browser
Try examples:

Filter this data down to the items I need and filter active users.

{
"users": [
{
"name": "Alice",
"active": true
},
{
"name": "Bob",
"active": false
},
{
"name": "Charlie",
"active": true
}
]
}
Output
1{
2 "users": [
3 {
4 "name": "Alice",
5 "active": true
6 },
7 {
8 "name": "Charlie",
9 "active": true
10 }
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.

Read integration guide

Works with:

  • API responses
  • Nested JSON
  • Arrays & objects

Example: input → output

Input / Output
Input
{
"users": [
{
"name": "Alice",
"active": true
},
{
"name": "Bob",
"active": false
},
{
"name": "Charlie",
"active": true
}
]
}
Output
{
"users": [
{
"name": "Alice",
"active": true
},
{
"name": "Charlie",
"active": true
}
]
}

Related tools

Advanced usage (optional)

Filter

v1.0.0
Structure
objectarraydestructive

Description

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 element
  • index — the element's index (0-based)

The expression must return a truthy value to keep the item.

Configuration

FieldTypeDefaultDescription
Filter Typeenumvaluekey, value, or javascript
Expressionstring(required)Search text or JS expression
Case SensitivebooleanfalseCase 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 equal

String 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 match

Type 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-null

Combining Conditions

item.active && item.age >= 18                    // AND
item.role === "admin" || item.role === "editor"  // OR
!(item.deleted || item.archived)                 // NOT

Working with Nested Data

item.address && item.address.city === "London"   // nested property
(item.tags || []).includes("featured")           // safe array check
Object.keys(item).length > 3                    // object size

Examples

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

NameTypeDefaultDescription
Filter Typeenumvaluekey: 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
Expressionstring(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 SensitivebooleanfalseOnly applies to key and value filter types

Examples

AI Prompt
Filter this data down to the items I need and filter active users.
{
"users": [
{
"name": "Alice",
"active": true
},
{
"name": "Bob",
"active": false
},
{
"name": "Charlie",
"active": true
}
]
}
Output
1{
2 "users": [
3 {
4 "name": "Alice",
5 "active": true
6 },
7 {
8 "name": "Charlie",
9 "active": true
10 }
11 ]
12}
Config
Filter Type
javascript
Expression
item.active === true
Case Sensitive
OFF

API Usage

POST /api/v1/utilities/structure.filter
Example:
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}}'
Response
1{
2 "users": [
3 {
4 "name": "Alice",
5 "active": true
6 },
7 {
8 "name": "Charlie",
9 "active": true
10 }
11 ]
12}