Herramientas Guías
text Gratis Sin registro

Resaltador de Diferencias de Texto

Compare dos textos con resaltado de diferencias a nivel de palabra, carácter o línea.

Cargando la herramienta…

Acerca de esta herramienta

Pegue dos fragmentos de texto y vea al instante qué cambió. Cambie entre los modos de diferencias por palabra, por carácter y por línea. El contenido añadido se resalta en verde, el contenido eliminado en rojo con tachado y se muestra una puntuación de similitud.

Cómo usar

  1. 1 Paso 1: Pegue o escriba su texto original en el panel izquierdo.
  2. 2 Paso 2: Pegue o escriba el texto nuevo/modificado en el panel derecho.
  3. 3 Paso 3: Elija un modo de diferencias: Palabra, Carácter o Línea.
  4. 4 Paso 4: Vea las diferencias resaltadas en línea o cambie a la vista lado a lado, y compruebe el resumen de estadísticas.

What a text diff actually computes

Comparing two pieces of text is not as simple as walking them side by side and flagging the first character that differs — that would mark everything after a single inserted word as "changed." A proper diff finds the longest common subsequence (LCS): the largest set of pieces that appear, in the same order, in both versions. Whatever is left over on the original side was deleted, and whatever is left over on the new side was added. This tool implements that LCS algorithm directly, so it identifies the smallest real set of insertions and deletions rather than a naive position-by-position mismatch.

Three granularities: line, word, and character

The same text can be compared at three levels, and choosing the right one is the difference between a useful diff and a noisy one:

ModeComparesBest for
Linewhole lines split on newlinesCode, config files, logs — anything line-structured
Wordwords and the whitespace between themProse, edited paragraphs, copy revisions
Characterevery single characterSpotting a one-letter typo or a changed digit

Word mode is the most common choice for everyday text because it keeps unchanged words intact and highlights only the words that moved, while line mode mirrors what developers see in version control. Character mode is the most precise but also the busiest — use it when you suspect a tiny change you cannot find by eye.

A worked example

Put The quick brown fox on the left and The slow brown fox jumps on the right, in word mode. The LCS is "The brown fox" — those words survive in order. The tool marks quick as removed (struck through, red), slow as added (green), and jumps as added at the end. It then reports the statistics: +2 words added, −1 word removed, and a similarity score. Similarity is computed as twice the number of matching tokens divided by the total tokens in both texts, expressed as a percentage — so two identical texts read 100%, and texts with nothing in common approach 0%.

Inline versus side-by-side views

The inline view weaves both versions into one stream: deletions struck through in red, insertions highlighted in green, sitting next to the unchanged text. It is compact and good for short edits. The side-by-side view puts the original on the left with only its deletions marked and the new version on the right with only its additions marked, which makes it far easier to read a heavily rewritten passage. You can switch views freely; the underlying diff is the same, only the presentation changes.

Practical use cases

  • Reviewing edits. Paste a draft and its revision to see exactly what an editor or collaborator changed, word for word.
  • Catching silent config changes. Diff two versions of a settings file in line mode to find the one value that was altered.
  • Comparing terms or contracts. Word mode surfaces every clause that was added, removed, or reworded.
  • Verifying a copy-paste. Character mode confirms whether two strings that look identical truly are, down to a trailing space.

Common mistakes and limits

  • Using character mode on long text. It produces an overwhelming amount of highlighting and is slow; reach for word or line mode unless you are hunting a single character.
  • Forgetting whitespace counts. In word mode the spaces between words are tokens too, so a change in spacing can show up as a difference — usually what you want, occasionally surprising.
  • Pasting huge inputs. The LCS algorithm builds a comparison grid, so cost grows with the product of the two token counts. This tool caps the combined size (around 20,000 tokens total) and warns you to trim the input rather than freezing the page.
  • Expecting it to detect moved blocks. A paragraph relocated from top to bottom reads as one deletion plus one insertion, not a "move" — that is inherent to how diffs work.

Privacy

Both texts are compared entirely in your browser using the built-in algorithm — nothing is uploaded or stored on a server. That makes it safe to diff confidential drafts, internal config, or unreleased copy, and it works even with your network disconnected.

Preguntas frecuentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}