FIRST CH TOOLS / 15 DIFF CHECKER
Text & Code Diff Checker
Paste two texts or code snippets and every addition, deletion and change is highlighted line by line and word by word. For proofreading drafts, reviewing CSS/JS edits and comparing config files — and it exports a unified diff (.patch).
Differences
The export is a standard unified diff with three lines of context — git apply and patch read it as-is.
How to Use
- Drop in both versionsPaste the original on the left and the changed version on the right, or load text files with the File buttons. Comparison runs as you type.
- Choose how to read itSwitch between the inline view and the side-by-side view. For long documents, "Collapse unchanged" keeps only three lines of context around each change.
- Take the result with youCopy the diff as a unified diff (.patch) or download it. Everything runs in your browser and nothing is uploaded.
About This Tool
Lines are matched with patience diff: lines that occur exactly once in both texts become anchors that split the problem into small ranges, and only the ranges without anchors fall back to Myers’ shortest-edit-script algorithm. This is the same idea as Git’s --patience, and it avoids the failure mode where reordered blocks get matched to unrelated lines and the whole file turns red and green.
Paired changed lines are compared again at token level — runs of letters and digits are one token, CJK characters are one token each — and only the differing tokens are shaded. If a pair shares less than 30% of its characters it is treated as two unrelated lines and left unshaded. CRLF, CR and LF all count as the same line break, and trailing-whitespace-only differences are ignored by default (ignoring all whitespace is optional).
Each side is compared up to 50,000 lines. When two large, entirely unrelated texts are compared, the search stops at a bounded edit distance and falls back to "replace the whole block" so the browser never locks up.
From AI Agents
This diff logic is also published as the diff_check tool of the MCP (Model Context Protocol) server @first-ch/tools-mcp, so AI agents can call it directly without driving a browser. See Using these tools from AI agents for setup.
Setup
claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
Example calls
# unified diff plus the change counts diff_check(a="original text", b="changed text") # compare two files, including word-level changes diff_check( pathA="/path/old.css", pathB="/path/new.css", format="both", ignoreWhitespace=true)
Other Tools
- 01Batch Image → WebP ConverterWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 11Encoding & Line Ending ConverterEncoding Converter
- 12Batch Image → AVIF ConverterAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 16Cron Expression ExplainerCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出