Comparador de textos y diferencias gratuito
Compara dos bloques de texto y ve al instante qué ha cambiado. Este comparador resalta las líneas añadidas, eliminadas y sin cambios una al lado de la otra, para detectar ediciones en código, configuraciones o documentos de un vistazo.
Comparing text is usually followed by Find & Replace Text if the difference should be corrected, and by Remove Extra Spaces & Line Breaks if invisible whitespace is the cause. For a structural comparison rather than a textual one, the JSON Validator checks the shape.
Cómo usar Comparador de texto
- 1 Paste the original text in the left pane and the changed text in the right.
- 2 Press Compare. Removed lines are marked in one style and added lines in another.
- 3 Switch between line and word comparison if the changes are small within long lines.
- 4 Ignore whitespace if the two versions were formatted differently.
Cómo usarlo
Pega el texto original a la izquierda y el modificado a la derecha. La comparación se actualiza sola mientras escribes. Usa la barra de estadísticas para ver cuántas líneas se añadieron, se eliminaron o quedaron igual.
- Comparación línea por línea con resaltado de color
- Verde = añadido, rojo = eliminado, gris = sin cambios
- Opción de distinguir mayúsculas y de recortar espacios en blanco
- Copia el informe de diferencias con un clic
Cómo funciona la comparación
La herramienta divide ambas entradas en líneas y ejecuta una comparación de subsecuencia común más larga para encontrar las líneas coincidentes, insertadas y eliminadas. Es la misma familia de algoritmos que usa Git para mostrar diferencias, así que el resultado es coherente con lo que verías en un sistema de control de versiones.
Preguntas frecuentes
What is the difference between a line diff and a word diff?
A line diff compares whole lines and reports any line that differs as entirely changed. A word diff compares within lines, so it can show that one word was inserted into an otherwise identical paragraph. For code, line diffs are the convention because a change usually affects whole statements. For prose, word diffs are far more useful.
Why does my diff show every line as changed?
Usually because of line endings or trailing whitespace. A file converted from Windows to Unix line endings has no content differences at all but differs on every line. Similarly, a file that gained a trailing space on each line, or an extra blank line at the start, produces a diff of the whole file. The ignore options exist for exactly this.
How do I compare versions that are not plain text?
By extracting the text first. Configuration in JSON or YAML can be pasted directly. Documents need their text extracted, and binary files cannot be compared this way at all. For structured data, formatting both sides before comparing removes formatting noise and leaves the real change.
Herramientas para desarrolladores relacionadas
También te puede interesar
Herramientas de otras categorías que suelen combinarse con Comparador de texto: