Developer Tools

Text Diff

Compare two texts side-by-side or in unified format with line, word, and character-level highlighting.

Original
Modified

Options

Inline diff:

Paste text into both panes above to see the diff — or .

All diffing runs entirely in your browser. Your text is never sent anywhere.

☕ Love this tool? Support the developer.

100% free — no ads, no limits. Your support keeps every tool free.

$

Secure payment via Stripe · No account needed

About Text Diff

OptiPix Text Diff is a full-featured text comparison tool that instantly shows you what changed between two versions of any text. Paste your Original and Modified text into the two panes and get a detailed diff in milliseconds. Choose between Side-by-Side view — with aligned line numbers, red-highlighted deletions, green additions, and yellow changed lines — or Unified diff view with the classic -/+ prefix format and 3 lines of context around each change. Within changed lines, character-level or word-level inline highlighting pinpoints exactly which characters differ. Options let you ignore case, collapse whitespace differences, and trim trailing spaces so you focus on meaningful changes. A live statistics panel shows lines added, deleted, changed, unchanged, and overall percentage identical. Copy the result as a standard unified diff string or download it as a .diff file. Drop .txt files directly onto either pane to load them. All processing happens 100% in your browser — your text never leaves your device.

How It Works

The tool uses the 'diff' npm library (diffLines, diffWords, diffChars) to compute an edit-distance-based diff between the two inputs. For Side-by-Side view it pairs removed/added line blocks and aligns them; for Unified view it applies a 3-line context window. Inline highlighting runs a second word- or character-level diff pass on each changed line pair.

Use Cases

  • Compare two versions of a document or article
  • Review code changes without a full IDE
  • Spot differences between configuration files
  • Verify that edits were applied correctly in any text
  • Generate a .diff patch file for sharing changes

Frequently Asked Questions

What diff views are available?
Two views: Side-by-Side (Original left, Modified right with aligned line numbers) and Unified (single column with - prefix for deleted and + prefix for added lines, 3 lines of context).
What does the inline character highlighting do?
Within changed lines, the tool highlights exactly which characters or words differ — red for removed characters, green for added ones — so you don't need to scan entire lines manually.
What do the options do?
Ignore Case makes A and a identical. Ignore Whitespace collapses multiple spaces into one. Trim Trailing Whitespace removes trailing spaces/tabs from each line before comparing.
Can I compare files?
Yes. Drop any .txt file onto the Original or Modified pane to load it instantly. The diff updates automatically after a short debounce.
Is my text sent to any server?
No. All diffing uses the open-source 'diff' library running entirely in your browser. Your text never leaves your device.

Related Tools

All 102 Tools

Image CompressorBackground RemoverVideo CompressorImage UpscalerOCR Text ExtractorFormat ConverterImage ResizerEXIF RemoverFace BlurDepth EstimationQR Code GeneratorWatermark MakerColor Palette ExtractorPhoto FiltersImage to PDFObject DetectionImage ClassifierImage CaptionerAI Image GeneratorMeme GeneratorGIF MakerPhoto Collage MakerImage CropPhoto EffectsImage to SVGColor ChangerNoise RemoverPhoto RestorationColor PickerFavicon GeneratorImage to Base64Image Metadata ViewerImage AnnotatorPassport Photo MakerDocument ScannerASCII Art GeneratorImage ComparisonSprite Sheet GeneratorObject RemoverPanorama MakerWord CounterCase ConverterLorem Ipsum GeneratorUUID GeneratorUnix Timestamp ConverterText DiffURL Encoder / DecoderHTML Entity Encoder / DecoderBase64 Text Encoder / DecoderText to Binary / Hex / OctalHash GeneratorJSON Formatter / ValidatorRandom String GeneratorCSV ↔ JSON ConverterMarkdown EditorUnit ConverterPercentage CalculatorBMI CalculatorAge CalculatorTip CalculatorCSS Gradient GeneratorCSS Box Shadow GeneratorCSS Border Radius GeneratorGlassmorphism GeneratorNeumorphism GeneratorCSS Text Shadow GeneratorFlexbox PlaygroundCSS Grid GeneratorAudio TrimmerAudio ConverterAudio MergerAudio RecorderVideo to Audio ExtractorAudio Speed ChangerAudio Volume BoosterRingtone MakerVocal RemoverText to SpeechSpeech to TextAudio Noise RemoverAudio EqualizerAudio EffectsVideo TrimmerVideo MergerVideo ResizerVideo Speed ChangerVideo RotatorVideo to MP4 ConverterAdd Music to VideoMute VideoVideo LooperReverse VideoVideo ScreenshotAdd Subtitles to VideoVideo WatermarkScreen RecorderWebcam RecorderSlideshow MakerVideo FiltersCron Expression BuilderRegex TesterUnix Timestamp Converter