Add Conditional Column to JSON Files Online
Add a new column to JSON files based on an if/else condition directly in your browser. Set a value for rows that match and a different value for rows that don't — no upload required.
How to add Conditional Column to JSON files
- Drop your file onto the upload area. The first 200 rows are shown.
- Build the condition: pick the column in If column, choose an operator such as equals, contains, greater than or is empty / null, and type the compare value.
- Set the Then value for rows that match and the Else value for rows that do not. The defaults are true and false.
- Name the new column (the default is new_column) and click Add Column. A one-line summary of the rule is shown above the button so you can check it.
- Check the preview and download the file. The new column is added at the end.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Worked example
A help desk promises a first response within 48 hours. The team lead wants a flag on every ticket in this week's export so overdue ones can be filtered and chased.
Input (JSON)
[
{
"ticket_id": 5012,
"priority": "high",
"hours_open": 52.5
},
{
"ticket_id": 5013,
"priority": "low",
"hours_open": 6
},
{
"ticket_id": 5014,
"priority": "medium",
"hours_open": 48
},
{
"ticket_id": 5015,
"priority": "high",
"hours_open": null
},
{
"ticket_id": 5016,
"priority": "low",
"hours_open": 120.25
}
]Settings
- If column: hours_open
- Operator: > greater than
- Value: 48
- Then: overdue
- Else: on track
- New column name: sla_status
Result
| ticket_id | priority | hours_open | sla_status |
|---|---|---|---|
| 5012 | high | 52.5 | overdue |
| 5013 | low | 6 | on track |
| 5014 | medium | 48 | on track |
| 5015 | high | NULL | on track |
| 5016 | low | 120.25 | overdue |
Greater than is strict, so ticket 5014 at exactly 48 hours is on track. Pick greater or equal to include it. Ticket 5015 has no hours recorded. An empty value never passes a comparison, so it falls to the Else value. Add a second run with is empty / null if missing data needs its own label.
Working with JSON files
Top-level keys are offered in If column. JSON numbers load as numeric columns and work with the comparison operators. JSON booleans can be tested with equals and the value true. Objects missing the key are treated as null, so they match is empty / null and fall to Else for every other operator. That is a simple way to flag incomplete records before import. Numbers stored as strings, such as "48", are still compared as numbers by the greater than and less than operators.
The new key is added to every object and always holds a string. Typing true and false in Then and Else produces "true" and "false" in quotes, not JSON booleans. Nested objects cannot be tested directly, because the operators compare plain values. Flatten the JSON first if the condition depends on a field like customer.tier. In contains, starts with and ends with, an underscore or percent sign in your value matches only itself.
Frequently Asked Questions
Are the new JSON values booleans or strings?
Strings. Then and Else are written as text, so true becomes "true". Run Cast Columns on the new key if you need JSON booleans.
How do I flag JSON records that are missing a field?
Pick the field in If column and choose is empty / null. Objects without the key, with null, or with an empty string all match.
Can I add more than one condition, like IF / ELSE IF?
No. Each run applies one condition with one Then and one Else value. For more outcomes, run the tool again on the result, or write a CASE WHEN expression in the SQL workspace.
What happens to empty values in the condition column?
They never pass equals, not equals or a comparison, so they get the Else value. Use the is empty / null operator to target them directly.
What if I type text as the value for greater than?
On a number column the tool stops and asks for a number. A value such as "48h" or "1,200" is not accepted. Enter digits only, with a dot for decimals. On a date column, type a date such as 2026-04-11.
Related Tools
Filter JSON Files Online
Filter rows in JSON files by column value, directly in your browser. Your data stays on your device.
Count Values in JSON Files Online
Group and count rows by any column in JSON files directly in your browser. Sort by frequency or value to find the most common entries — no upload required.
Cast Column Types in JSON Files Online
Change column data types in JSON files directly in your browser. Cast text to numbers, dates to timestamps, or any supported type conversion — no upload required.
Add Conditional Column to CSV Files Online
Add a new column to CSV files based on an if/else condition directly in your browser. Set a value for rows that match and a different value for rows that don't — no upload required.
Add Conditional Column to Excel Files Online
Add a new column to Excel files based on an if/else condition directly in your browser. Set a value for rows that match and a different value for rows that don't — no upload required.
Add Conditional Column to Parquet Files Online
Add a new column to Parquet files based on an if/else condition directly in your browser. Set a value for rows that match and a different value for rows that don't — no upload required.
JSON Viewer Online
View and inspect JSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert JSON to Parquet Online
Convert JSON files to Parquet format directly in your browser. No upload required — your data never leaves your device.