Find & Replace (Free Online Tool)
Find and replace matching keys or values across JSON using broad search patterns
Paste your JSON → Get results instantly (no signup)
→ Find and replace matching values or keys in this data and clear password fields.
1{2 "user": "admin",3 "password": "",4 "database": {5 "host": "db.example.com",6 "password": ""7 }8}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
{ "user": "admin", "password": "s3cret!", "database": { "host": "db.example.com", "password": "db-pass-123" }}{ "user": "admin", "password": "", "database": { "host": "db.example.com", "password": "" }}Related tools
- Rename KeysRename known keys or convert key casing without changing the underlying values
- FilterFilter rows, items, keys, or values by explicit conditions and keep only the matches you want
- 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)
Find & Replace
v1.0.0Description
Find & Replace
Find keys or values in JSON and replace them. Supports three modes for different use cases.
Modes
Set Mode (set)
Matches key names exactly and replaces the entire value with the replacement. The replacement is parsed as a JSON value, so you can set fields to strings, numbers, booleans, null, objects, or arrays.
Value Mode (value)
Finds text inside string values and replaces the matched portion. Useful for updating URLs, fixing typos, or transforming text content.
Key Mode (key)
Finds text inside key names and replaces the matched portion. Useful for renaming fields across your JSON structure.
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| Mode | enum | set | set, value, or key |
| Search | string | (required) | Text to find |
| Replacement | string | "" | Replacement text or JSON value |
| Case Sensitive | boolean | false | Whether matching is case-sensitive |
| Target Paths | path-picker | (all) | Optionally limit to specific paths |
Replacement Values in Set Mode
The replacement string is parsed as JSON:
""or any text → stringnull→ nulltrue/false→ boolean0,42,3.14→ number{}→ empty object[]→ empty array{"key": "value"}→ object
Expressions
The replacement field supports {{expression}} syntax for dynamic replacements. Use old to reference the current value being replaced.
Expression Examples
| Expression | Description |
|---|---|
{{old.toUpperCase()}} | Uppercase the matched value |
{{old.toLowerCase()}} | Lowercase the matched value |
{{old.trim()}} | Trim whitespace |
{{old + '_backup'}} | Append a suffix |
prefix_{{old}} | Prepend a prefix (mixed literal + expression) |
{{old.replace("http", "https")}} | Sub-replacement within value |
{{old.split("@")[0]}} | Extract part of a string |
How old Works in Each Mode
- Set mode:
oldis the current value of the matched key (string, number, boolean, etc.) - Value mode:
oldis the full string value being replaced - Key mode:
oldis the current key name string
Notes
- Expressions are evaluated safely using an AST parser (not
eval) - If the replacement contains no
{{...}}syntax, it is treated as a plain literal - You can mix literal text and expressions:
backup_{{old}}_v2
Use Cases
Security & Data Sanitization
- Clear passwords: Search
password, replace with""— wipe all password fields - Redact PII: Search
email, replace with[REDACTED]— mask personal info - Remove tokens: Search
token, replace withnull— clear auth tokens - Mask credit cards: Search
cardNumber, replace with****— hide payment data - Clear secrets: Search
secret, replace with""— sanitize config files - Remove API keys: Search
apiKey, replace withnull— strip credentials
Data Migration
- Update domains: Value mode, search
old-api.com, replace withnew-api.com - Change API versions: Value mode, search
/v1/, replace with/v2/ - Update protocols: Value mode, search
http://, replace withhttps:// - Fix environment URLs: Value mode, search
staging., replace withproduction.
Field Renaming
- Rename abbreviations: Key mode, search
fname, replace withfirstName - Update naming convention: Key mode, search
user_name, replace withuserName - Fix typos in keys: Key mode, search
adress, replace withaddress
Data Normalization
- Standardize booleans: Set mode, search
enabled, replace withtrue - Set defaults: Set mode, search
status, replace with"active" - Clear deprecated fields: Set mode, search
legacyId, replace withnull - Replace placeholders: Value mode, search
TODO, replace with actual value
Examples
Clear Password Fields
Input:
{
"user": "admin",
"password": "s3cret!",
"database": {
"host": "db.example.com",
"password": "db-pass-123"
}
}Config: mode: set, search: password, replacement: ""
Output:
{
"user": "admin",
"password": "",
"database": {
"host": "db.example.com",
"password": ""
}
}Redact Email Addresses
Input:
{
"users": [
{ "name": "Alice", "email": "alice@company.com" },
{ "name": "Bob", "email": "bob@company.com" }
]
}Config: mode: set, search: email, replacement: [REDACTED]
Output:
{
"users": [
{ "name": "Alice", "email": "[REDACTED]" },
{ "name": "Bob", "email": "[REDACTED]" }
]
}Replace URL Domain
Input:
{
"api": "https://old-api.example.com/v1/users",
"docs": "https://old-api.example.com/docs"
}Config: mode: value, search: old-api.example.com, replacement: api.newsite.io
Output:
{
"api": "https://api.newsite.io/v1/users",
"docs": "https://api.newsite.io/docs"
}Set Tokens to Null
Input:
{
"name": "Test User",
"token": "eyJhbGciOiJIUzI1NiJ9.xxxx",
"refreshToken": "rt_abc123"
}Config: mode: set, search: token, replacement: null (case-insensitive matches both token and refreshToken)
Output:
{
"name": "Test User",
"token": null,
"refreshToken": null
}Tip: Enable "Case Sensitive" if you only want to matchtokenexactly and notrefreshToken.
Uppercase Values with Expression
Input:
{
"status": "active",
"role": "admin",
"level": "senior"
}Config: mode: set, search: status, replacement: {{old.toUpperCase()}}
Output:
{
"status": "ACTIVE",
"role": "admin",
"level": "senior"
}Tip: Expressions useoldto reference the current value. Combine with string methods liketoUpperCase(),toLowerCase(),trim(),replace(), andsplit().
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Mode | enum | set | set: match key names and replace the entire value. value: find text inside string values and replace. key: find text inside key names and replace.
set value key |
| Search | string | (required) | Text to find (matches key names in set/key mode, string values in value mode) |
| Replacement | string | | Replacement text or value. In set mode this is parsed as JSON (e.g. "", null, 0, false, {}, []). In value/key mode this is plain text. Supports {{expression}} syntax — use {{old}} to reference the current value (e.g. {{old.toUpperCase()}}, {{old + '_backup'}}, prefix_{{old}}). |
| Case Sensitive | boolean | false | |
| Target Paths (optional) | path-picker | — | Narrow replacement to specific paths only. Leave empty to apply everywhere. |
Examples
Find and replace matching values or keys in this data and clear password fields.1{2 "user": "admin",3 "password": "",4 "database": {5 "host": "db.example.com",6 "password": ""7 }8}API Usage
curl -X POST https://your-domain.com/api/v1/utilities/structure.find-replace \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"user":"admin","password":"s3cret!","database":{"host":"db.example.com","password":"db-pass-123"}}},"config":{"mode":"set","search":"password","replacement":"","caseSensitive":false}}'1{2 "user": "admin",3 "password": "",4 "database": {5 "host": "db.example.com",6 "password": ""7 }8}