Back to Nodes

Text Diff

Last updated Jul 27, 2025

n8n node for text diff operations

2 Weekly Downloads
10 Monthly Downloads

Included Nodes

Text Diff

Description

n8n-nodes-text-diff

This is an n8n community node that provides text comparison and diff functionality using the popular diff package.

Features

The Text Diff node offers several text comparison operations:

  • Character Diff: Compare texts character by character
  • Word Diff: Compare texts word by word
  • Line Diff: Compare texts line by line
  • Sentence Diff: Compare texts sentence by sentence
  • Create Patch: Generate unified diff patches

Installation

Follow the installation guide in the n8n community nodes documentation.

Community Nodes (Recommended)

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-text-diff
  4. Agree to the risks of using community nodes and select Install

After installation restart n8n to use the node.

Manual Installation

To get started install the package in your n8n root directory:

npm install n8n-nodes-text-diff

For Docker-based deployments, add the following line before the font installation command in your n8n custom docker file:

RUN cd /usr/local/lib/node_modules/n8n && npm install n8n-nodes-text-diff

Usage

  1. Add the "Text Diff" node to your workflow
  2. Configure the operation type (Character, Word, Line, Sentence, or Create Patch)
  3. Provide the original text and new text to compare
  4. Configure options like ignore case, ignore whitespace, output format, etc.
  5. Execute the node to get detailed diff results

Output Formats

  • Detailed Changes: Complete change objects with metadata and statistics
  • Summary Only: Just the summary statistics (counts of additions, removals, etc.)
  • Changes Only: Only the actual changes without metadata

Example Output

For a word diff operation, you'll get:

{
  "operation": "diffWords",
  "summary": {
    "totalChanges": 5,
    "addedCount": 2,
    "removedCount": 1,
    "unchangedCount": 8,
    "hasChanges": true
  },
  "changes": [
    { "count": 3, "value": "The quick " },
    { "count": 1, "added": true, "value": "red " },
    { "count": 1, "removed": true, "value": "brown " },
    { "count": 4, "value": "fox jumps" }
  ]
}

Compatibility

  • Requires n8n v0.216.0 or later
  • Compatible with all n8n deployment methods

License

MIT

Resources