Text Diff Checker

Compare two pieces of text and highlight the differences

0 characters · 1 lines

0 characters · 1 lines

API Usage

Integrate text comparison into your applications with our REST API.

Endpoint

POST /api/text-diff

Request Body

{
  "text1": "Hello World",
  "text2": "Hello Developer",
  "mode": "words",              // "chars", "words", or "lines"
  "ignoreCase": false,          // optional
  "ignoreWhitespace": false     // optional
}

cURL Example

curl -X POST https://toolteeno.com/api/text-diff \
  -H "Content-Type: application/json" \
  -d '{
    "text1": "The quick brown fox",
    "text2": "The fast brown dog",
    "mode": "words"
  }'

JavaScript Example

const response = await fetch('/api/text-diff', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    text1: 'Hello World',
    text2: 'Hello Developer',
    mode: 'words',
    ignoreCase: false
  })
});

const data = await response.json();
console.log(data.stats.similarity); // 50.00

Python Example

import requests

response = requests.post('https://toolteeno.com/api/text-diff', json={
    'text1': 'Line 1\nLine 2',
    'text2': 'Line 1\nLine 3',
    'mode': 'lines'
})

data = response.json()
print(f"Changes: {data['stats']['totalChanges']}")

Common Use Cases

  • Compare document versions to track content changes over time
  • Review code changes before committing to version control
  • Detect plagiarism or measure text similarity between documents
  • Validate data transformations and migration results
  • Track configuration file changes across deployments
  • Compare API responses or JSON outputs for regression testing