Comparar Textos
Em alta 🔥Compare dois textos e destaque as diferenças.
Como usar Comparar Textos
- 1Cole o texto original no Texto A
- 2Cole o texto modificado no Texto B
- 3Clique em Comparar para ver as diferenças
- 4Revise a saída diff codificada por cor
Sobre Comparar Textos
Comparador de Texto (Diff) permite colar duas versões de texto em painéis lado a lado e ver instantaneamente as diferenças. Linhas presentes apenas no Texto B (versão mais recente) são destacadas em verde como adições, linhas presentes apenas no Texto A (original) são destacadas em vermelho como remoções. Toda a comparação é executada localmente no seu navegador.
Principais recursos de Comparar Textos
- Line-by-line comparison of two text versions
- Green highlights for lines added in Text B (new version)
- Red highlights for lines removed from Text A (original)
- Gray display for unchanged lines
- Shows a summary count of added and removed lines
- Works on any text — documents, code, config files, contracts
- Instant comparison with no submit delay
- Runs entirely in-browser with no data transmission
Exemplos
Compare two versions of a configuration file
Identify which settings were changed between the old and new version of a config file.
Entrada
Text A: timeout=30 retries=3 log_level=info Text B: timeout=60 retries=5 log_level=debug
Saída
Red: timeout=30, retries=3, log_level=info Green: timeout=60, retries=5, log_level=debug
Review edits made to a contract paragraph
Spot every changed line between an original contract draft and the revised version.
Entrada
Text A: The payment is due on the 1st. Text B: The payment is due on the 15th.
Saída
Red: The payment is due on the 1st. Green: The payment is due on the 15th.
Casos de uso comuns
- Comparing two versions of a document to spot editorial changes
- Identifying which configuration file lines changed between deployments
- Reviewing contract or legal document revisions for changed clauses
- Comparing exported data files to find rows added or removed
- Auditing changes made to policy documents or terms of service
- Comparing two versions of a README or documentation page
Solução de problemas
Expecting word-level or character-level diff highlighting
Solução
This tool performs line-by-line comparison only. A changed line appears as both removed (red) and added (green) — the exact word or character that changed within the line is not highlighted separately. For character-level diff, you need a more advanced diff tool.
Whitespace differences not showing up as changes
Solução
Trailing spaces, tabs, or line ending differences (CRLF vs LF) that appear identical visually may or may not be detected as differences depending on how comparison is normalized. If you expect whitespace changes to be highlighted, ensure both texts use consistent line endings.
Reordered blocks showing many red and green lines instead of a swap indicator
Solução
The tool performs a line-by-line sequential diff, not a block-move detection. If a paragraph was moved from the middle to the top, it will appear as removed from its original position (red) and added at its new position (green) — not as a "moved" indicator.
Perguntas frequentes
Is the comparison case-sensitive?
Yes. By default, line-by-line comparison is exact and case-sensitive. A line reading "Hello" and a line reading "hello" are treated as different and will appear as a removal and addition respectively.
What do the colors mean?
Green lines are present in Text B (the new version) but not in Text A (the original) — these are additions. Red lines are present in Text A but not in Text B — these are removals. Gray lines appear in both texts unchanged.
Does it detect word-level changes within a line?
No. The tool compares entire lines. If one word in a line changes, the whole line appears as removed (red) and replaced by the new version (green). Character or word-level highlighting is not provided.
Can it compare code files?
Yes. Since it operates on plain text, it can compare any text-based files including source code, configuration files, JSON, YAML, and Markdown. Paste the file contents into Text A and Text B.
What algorithm is used for the diff?
The tool uses a standard longest common subsequence (LCS) algorithm, the same approach used by Unix diff and git diff, to identify the minimum set of additions and removals that transform Text A into Text B.
Is there a text length limit?
No. Comparison runs locally in your browser. Long documents with hundreds of lines are compared instantly without any server interaction.
Is my text sent to a server?
No. All comparison runs in client-side JavaScript. Your text is never uploaded, stored, or transmitted to any server.
Can I compare texts with different line endings (CRLF vs LF)?
The tool normalizes line endings before comparison, so Windows CRLF and Unix LF line endings are treated as equivalent. This prevents spurious "all lines changed" results when comparing files from different operating systems.