SearchReplace
searched_string
STRING_REPLACEMENT

Finds and replaces content in all files with MIME type names, that includes text/ or json substring.

Download replaced results with EXPORT ZIP button.

File Contents Replacer

About File Contents Replacer

A File Contents Replacer is a tool designed to automate the process of finding and replacing specific text in files or files in zip archives.

It allows users to quickly search for particular words, phrases, or strings and replace them with new content across multiple files at once. This is especially useful for developers, content creators, and administrators who need to make bulk updates or corrections in large sets of text files.

By using a file contents replacer, you save time and reduce the chance of errors compared to manual editing. You can upload one or more files, or a zip archive with files whose content will be replaced.

This tool replaces the contents in files according to these conditions: getMimeType().includes('text/') || getMimeType().includes('json').

This is most common file extensions, that will be proceeded: .txt, .htm, .html, .css, .js, .json, .csv, .ics, .mjs, .jsonld
Common MIME file types and their extensions

The tool is a fork of Gildas Lormeau zip-manager.

File Contents Replacer: Bulk Find & Replace Across Text-Based Files

File Contents Replacer scans folders, detects files whose MIME type includes text/ or json(eg: .txt, .htm, .html, .css, .js, .json, .csv, .ics, .mjs, .jsonld), and performs safe, repeatable find-and-replace operations at scale. Ideal for refactors, rebranding, URL migrations, config edits, and localization work.

What the tool does

  • MIME-aware targeting: processes only files whose MIME name contains text/ or json (e.g., HTML, CSS, JS, CSV, MD, XML, YAML, INI, JSON).
  • Precise find & replace: simple text or regex patterns, optional case sensitivity and whole-word matching.
  • Dry-run preview: see exactly which files and lines will change before writing.
  • Selective scope: include/exclude paths, glob patterns, and file extensions.
  • Encoding support: utf-8 by default with graceful handling of BOM.
  • Safe writes: optional backups and atomic write strategy to minimize corruption risk.
  • Change report: per-file diff summary with counts of matches and replacements.

Common use cases

  • Rebranding & copy updates: product names, company details, legal text.
  • URL/domain migrations: replace legacy hosts, CDN paths, asset prefixes.
  • Config & secrets rotation: switch API endpoints or keys in non-binary configs.
  • Codebase refactors: rename modules, CSS classes, and feature flags.
  • Localization prep: extract or normalize hard-coded strings.
  • Data hygiene: fix JSON property names, CSV headers, or schema typos.

How it works

  1. Choose a root folder for the scan.
  2. Set your pattern (plain text or regex) and the replacement value.
  3. Refine scope with include/exclude globs and extension filters.
  4. Run a dry-run to preview matched files and line snippets.
  5. Apply changes with backups enabled for easy rollback.
  6. Review the report for counts, files changed, and skipped items.

Why use MIME filtering?

Binary files often contain byte sequences that look like text. MIME filtering limits operations to textual formats, reducing false matches and preventing file corruption in images, fonts, archives, and executables.

Best practices

  • Back up or use version control before large replacements.
  • Prefer regex boundaries (e.g., \b) to avoid partial word hits.
  • Target narrowly with include globs like **/*.js or content/**/*.md.
  • Test on a small subset then scale to the full tree.
  • Review diffs to confirm no unintended edits.

Limitations

  • Skips true binary formats by design; if a file reports a non-text MIME, it will not be modified.
  • Regex patterns that are overly broad can match more than intended—use preview and anchors.
  • Very large monolithic files may require more memory; split or scope as needed.

FAQ

Which files are included?
Any file whose MIME type contains text/ (e.g., text/html, text/css, text/markdown) or json (e.g., application/json).
Can I undo changes?
Yes. Enable backups to create .bak copies, or rely on your VCS to revert specific hunks.
Does it change file permissions or timestamps?
Permissions are preserved. Timestamps update on modified files only.
Will it rewrite line endings?
It preserves existing line endings (LF/CRLF) unless your environment enforces a different policy.
How do I avoid changing variables inside code blocks I don’t want touched?
Constrain scope with include globs, and use regex with anchors/contexts to match only safe regions.

Next step: Point the tool at your project root, run a dry-run preview, then apply replacements with backups enabled. Clean, fast, and predictable bulk edits.