sed Command Builder & Tester
Build and test sed commands against sample text in the browser. A pure-JavaScript sed interpreter (no WASM, no network) supports substitute (s///), delete (d), print (p), insert (i), append (a), change (c), and next (n) commands with line addressing (single line, range, $, /regex/), BRE and ERE (-E) regex flavours, flags (g, i, p, N), -n suppress-auto-print, -i in-place preview, auto delimiter selection (/, |, #, ~, ^) when search/replace contains a slash, GNU-vs-BSD -i guidance, backreference helper (\1..\9 and &), and per-command plain-English explanation. Visual builder, reverse explainer, recipe library, sample-text presets, history (max 20), shareable URL. Preview only — never edits real files. 100% client-side.
About sed Command Builder & Tester
Build and test sed commands against sample text in the browser. A pure-JavaScript sed interpreter (no WASM, no network) supports substitute (s///), delete (d), print (p), insert (i), append (a), change (c), and next (n) commands with line addressing (single line, range, $, /regex/), BRE and ERE (-E) regex flavours, flags (g, i, p, N), -n suppress-auto-print, -i in-place preview, auto delimiter selection (/, |, #, ~, ^) when search/replace contains a slash, GNU-vs-BSD -i guidance, backreference helper (\1..\9 and &), and per-command plain-English explanation. Visual builder, reverse explainer, recipe library, sample-text presets, history (max 20), shareable URL. Preview only — never edits real files. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
Is this a real sed engine?
It's a small pure-JavaJavaScript sed interpreter built from scratch — no WASM, no network. It supports the seven most-used commands — s (substitute), d (delete), p (print), i (insert), a (append), c (change), n (next) — with line addressing (single line N, range N,M, last line $, /regex/ pattern addresses), BRE and ERE (-E) regex flavours, flags (g, i, p, N), -n suppress-auto-print, and -i in-place preview. For features outside this subset (e.g. hold space hHgGxNPD, branch labels, multi-line N, runtime :labels) use sed.js.org or GNU sed directly.
How does the visual builder work?
Pick a command (substitute, delete, insert, append, change, print), fill in a small form (search, replace, line range, flags, delimiter), and the builder generates a valid sed script AND a copy-ready command `sed -E 's/foo/bar/g' file`. The auto-delimiter picks a safe separator (|, #, ~, ^) when your search or replace contains a /, so paths like /usr/local/bin don't break the command. Each command has a plain-English explanation.
How does the auto-delimiter work?
sed's s command uses / as the default delimiter: s/search/replace/. If your search or replace string contains / (e.g. a file path), the command would break. The builder detects this and switches to a different character — | by default, then #, ~, ^, %, @, !, ;, :, ,, . — whichever doesn't appear in your strings. The generated command uses the chosen delimiter consistently: s|/usr/local/bin|/opt/bin|g.
What about sed -i (in-place editing)?
This tool NEVER edits real files — it's a preview-only tester. But the generated command shows the correct -i syntax for both GNU sed (Linux: `sed -i 's/.../.../' file` or with backup `sed -i.bak 's/.../.../' file`) and BSD/macOS sed (`sed -i '' 's/.../.../' file` or `sed -i.bak 's/.../.../' file`). Toggle the GNU/BSD switch to see the right invocation for your platform.
What extra features does this tool have versus sed.js.org?
(1) Pure-JS interpreter — instant load, works offline, no WASM. (2) Visual builder for s/d/p/i/a/c/n with line addressing. (3) Auto-delimiter selection (|, #, ~, ^, …) when search/replace contains /. (4) BRE vs ERE (-E) toggle with backreference helper (\1..\9 and &). (5) Per-command plain-English explanation. (6) Reverse explainer that annotates a pasted sed script. (7) GNU vs BSD/macOS -i guidance. (8) Recipe library (12 common one-liners). (9) Sample-text library (CSV, log, code, config). (10) -n suppress-auto-print flag. (11) Diff view between input and output. (12) Copy command + copy output. (13) localStorage history (max 20). (14) Shareable URL with embedded script + input. 100% client-side — preview only, never edits real files.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.