Loading JSON Array Filter...
Please wait a moment

How to Filter JSON Arrays - Step by Step Guide

Step 1

Input Your JSON Array

Start by providing your JSON array! Whether you're working with arrays of objects, primitive values, or need to format JSON first, you have several convenient options for filtering JSON data:

•
Paste directly: Copy your JSON array and paste it into the input editor
•
Upload a file: Click "Upload" to select a .json or .txt file from your computer
•
Try the sample: Click "Sample" to load example data and see how the filter works
Step 2

Set Up Your Filter

Once your JSON array is loaded, configure your filter options:

•
Select filter key: For arrays of objects, choose which property to filter by (e.g., "name", "age", "department")
•
Choose operator: Select from equals, contains, starts with, ends with, greater than, less than, and more
•
Enter filter value: Type the value you want to filter by
•
No button to press: The output updates by itself about half a second after you stop typing or change an option

Example: Filter by Department = "Engineering"

Filter the array to show only items where department equals "Engineering". The tool will automatically show only matching items:

[
  {
    "name": "Alice Johnson",
    "department": "Engineering",
    "age": 28
  },
  {
    "name": "Diana Prince",
    "department": "Engineering",
    "age": 31
  }
]
Other Filter Examples:
  • • Contains: Filter names containing "John"
  • • Greater than: Filter age > 30
  • • Starts with: Filter department starting with "Eng"
Primitive Arrays:

For arrays like ["apple", "banana", "cherry"], filter directly by value without selecting a key

Step 3

View Filtered Results

The filtered array appears in the output panel, indented with two spaces. The items are copied from your input as you typed them, so long IDs and decimals like 14.50 don't change:

•
Result count: See how many items match your filter (e.g., "3 of 10"). This helps you understand the impact of your filter before exporting
•
Nothing matched? You get an empty array [] and a note saying which condition found nothing, so an empty result never looks like a bug
•
Errors with a location: If the input isn't valid JSON, you see the line and column of the first problem and what is wrong there
•
Wrapped arrays: Paste a whole API response such as {"users": [...]} and the array inside it is filtered

Example: Filter Results Visualization

The output shows only matching items. Here's what happens when filtering by different criteria:

Filter: age > 30

Shows: "3 of 5" items

Bob (35), Charlie (42), Diana (31)
Filter: name contains "Alice"

Shows: "1 of 5" items

Alice Johnson
Step 4

Export Your Filtered Array

When the result looks right, take it with you. The output is plain JSON you can use in any application or API:

•
Copy to clipboard: One click, ready to paste into your code editor, an API request or a test fixture
•
Download as file: Save it as filtered-array.json, a .json file with the same text you see on screen
•
Chain with other tools: The filtered output can be used with JSON Array Sorter, JSON to CSV, or JSON to Table for further processing

Example: Common Filter Use Cases

🔍 Data Search

Find specific records in large datasets, like customers by email domain or products by category

📊 Analytics

Filter data for analysis - show only high-value transactions, active users, or recent entries

🎯 API Filtering

Filter API response arrays before displaying in your frontend to show only relevant data

📈 Reports

Create focused reports by filtering data by date ranges, status, or other criteria before export

Frequently Asked Questions

How do I filter a JSON array?

Paste the array into the input box (or upload a .json file). If it holds objects, pick the key to filter on, choose a comparison and type the value. The output only keeps the items that match, and the badge tells you how many that is, for example "3 of 5". For a plain list of strings or numbers there's no key to pick: choose the comparison and type the value.

How are numbers and text compared?

Numbers are compared by value, digit for digit, so 8901240544102066246 and 8901240544102066247 are told apart and 14.50 equals 14.5. Text comparisons ignore upper and lower case. With > and <, a number in quotes such as "9.99" is compared as an amount when you type a number, and other text is compared alphabetically. Contains, starts with and ends with look at a number the way it is written, so "contains .50" finds 14.50. Typing null finds items where the value is null or the key is missing.

Will filtering change any of my values?

No. The items you keep are copied from your input as you typed them: long IDs, 14.50 with its trailing zero, 1e21, \u escapes and even a key written twice all come through unchanged. Only the indentation is redone, with two spaces.

What if my JSON is an object with the array inside it?

If the object holds exactly one array, such as {"users": [...]}, that array is filtered and a note above the output says which key it came from. The output is the filtered array on its own. When the object holds several arrays, paste just the one you want, from its [ to its matching ].

Can I filter by more than one condition?

One condition at a time. To combine two, filter by the first, copy the result back into the input, then apply the second. For OR-style searches, "contains" on a key that holds a list or an object searches its whole JSON text.

Is my JSON uploaded anywhere?

No. The filtering runs in your browser and nothing you paste or upload is sent to a server or kept. A reload starts with an empty editor.

Next steps for a filtered array: sort it, turn it into a spreadsheet with JSON to CSV, or look at it as a table.