# CompareText > CompareText (https://comparetext.org) is a free online diff checker. Paste two versions of a text, document, code file or data file and it highlights what changed: removed text in red on the left, added text in green on the right. Comparisons run in the browser, so the text is not uploaded unless the user clicks Share. No account is needed. CompareText compares text in two passes. First it lines up the two documents line by line, pairing each edited line with the line it came from. Then it compares each pair of lines word by word and character by character, so a single changed comma, number or word is highlighted on its own instead of the whole line. Lines that were added or removed outright are highlighted in full. The character-level engine is Google's diff-match-patch library (Apache 2.0). Line pairing uses a sequence alignment (Needleman-Wunsch) that scores how similar two lines are, so an edited line stays matched to its original even when lines are inserted or deleted next to it. Highlights always cover whole characters, including emoji, flags, accented letters and scripts such as Arabic, Hindi and Chinese. The site is in English at https://comparetext.org/. Older language-prefixed URLs (for example https://comparetext.org/de/compare-json) redirect permanently to the English page. ## Key facts - Price: free. No sign-up is needed to compare, upload, download or share. - Privacy: the comparison runs locally in the browser. Text is only stored on comparetext.org if the user clicks Share and agrees; the shared link expires after 1 week, 1 month (the default), 3 months, 6 months or 1 year. - Colours: red means removed (left pane), green means added (right pane). Each pane shows a change counter. - Options: "Ignore spaces" treats runs of spaces and tabs as one space and ignores leading and trailing spaces. "Ignore case" treats upper and lower case as equal. - Navigation: previous and next buttons jump between changes, and both panes scroll together. - Editor actions: Sample, Upload a file, Copy, Download, Clear, and Swap (exchange the left and right texts). - Accounts: optional. Signed-in users (email or Google) see the comparisons they have shared under "My Saved Comparisons" and can delete them. - Large inputs: documents with thousands of lines compare as you type. If more than about 2,000 lines differ on each side, the site switches to a faster character-level comparison. ## How the format-specific pages differ Every comparison page uses the same diff engine and gives the same highlights for the same input. The format pages add buttons that clean up the text before comparing, so formatting noise does not show up as changes: | Page | Extra tools | What they do | |---|---|---| | Compare JSON | Format, Sort keys, validation | Format pretty-prints with 2-space indentation. Sort keys sorts object keys alphabetically at every level on both sides, so key order stops showing up as a difference. Validation reports JSON syntax errors. | | API Response Diff | Format, Sort keys, validation | Same tools as Compare JSON, aimed at comparing two API responses. | | package.json Diff | Format, validation | Pretty-prints and validates both package.json files. | | Compare XML | Format, validation | Pretty-prints XML and reports well-formedness errors. | | Compare YAML | Format, validation | Format trims trailing whitespace and fixes the final newline. Validation flags tab indentation, which YAML 1.2 does not allow. | | Compare CSV | Format, validation | Format normalises line endings to LF and removes a UTF-8 byte order mark. Validation parses rows per RFC 4180 and flags the first row whose column count differs from the header. | | Compare SQL | Format | Splits statements on semicolons and upper-cases common keywords (SELECT, FROM, WHERE, JOIN and so on). It does not parse dialect-specific SQL. | Comparisons are text-based on all pages. CompareText does not match CSV rows by key or ignore XML attribute order; to ignore JSON key order, use the Sort keys button. ## Comparison tools - [Compare Text (home)](https://comparetext.org/): The main tool. Compare any two texts and see changes highlighted word by word. - [Compare JSON](https://comparetext.org/compare-json/): Compare JSON with formatting, key sorting and syntax validation. - [Compare XML](https://comparetext.org/compare-xml/): Compare XML documents with pretty-printing and well-formedness checks. - [Compare YAML](https://comparetext.org/compare-yaml/): Compare YAML configs and manifests; catches tab indentation. - [Compare CSV](https://comparetext.org/compare-csv/): Compare CSV exports; flags rows with the wrong number of columns. - [Compare SQL](https://comparetext.org/compare-sql/): Compare SQL queries, scripts and schema changes. - [Compare HTML](https://comparetext.org/compare-html/): Compare HTML markup and templates. - [Compare Markdown](https://comparetext.org/compare-markdown/): Compare Markdown documents and READMEs. - [Compare Config Files](https://comparetext.org/compare-config/): Compare .env, .ini, .properties and similar files between environments. ## Tools for specific jobs - [Contract Redline](https://comparetext.org/contract-redline/): Compare two versions of a contract to find added, removed and reworded clauses. - [Git Diff Online](https://comparetext.org/git-diff-online/): Compare two versions of a file the way a git diff would show them. - [package.json Diff](https://comparetext.org/package-json-diff/): See which dependencies and versions changed between two package.json files. - [API Response Diff](https://comparetext.org/api-response-diff/): Find why two API responses differ, for example staging against production. - [Resume Compare](https://comparetext.org/resume-compare/): Compare two drafts of a resume or CV. ## Guides - [How to Compare Two Text Files](https://comparetext.org/blog/how-to-compare-two-text-files/): Ways to compare two text files and read the result. - [How to Compare JSON Files](https://comparetext.org/blog/how-to-compare-json-files/): Comparing JSON when key order and formatting differ. - [How to Compare XML Files](https://comparetext.org/blog/how-to-compare-xml-files/): Comparing XML documents, attributes and nesting. - [How to Compare YAML Files](https://comparetext.org/blog/how-to-compare-yaml-files/): Spotting real YAML changes among indentation noise. - [How to Compare CSV Files](https://comparetext.org/blog/how-to-compare-csv-files/): Comparing CSV rows and columns. - [How to Compare HTML Files](https://comparetext.org/blog/how-to-compare-html-files/): Comparing HTML markup cleanly. - [Blog](https://comparetext.org/blog/): All guides. ## Frequently asked questions **Is CompareText free?** Yes. Every tool on comparetext.org is free and works without an account. **Does CompareText upload or save my text?** No, not unless you choose to share. The comparison runs in your browser. If you click Share and agree, both texts are stored on comparetext.org so the link works, and they are deleted when the link expires (1 week to 1 year). **How do I compare two texts online?** Open https://comparetext.org/, paste the original text in the left pane and the new version in the right pane. Removed text turns red on the left and added text turns green on the right, as you type. **Can I compare two files?** Yes. Use the Upload button above each pane to load a file into it. On the main page it accepts .txt, .md, .csv, .log, .json, .xml, .html, .css and .js files. **Can it ignore whitespace or capitalisation?** Yes. "Ignore spaces" treats any run of spaces or tabs as a single space and ignores spaces at the start and end of lines. "Ignore case" treats "Hello" and "hello" as the same. **Does it show which words changed, or only which lines?** Both. Edited lines are paired with their original line, and only the changed words or characters inside them are highlighted. Lines that were added or removed entirely are highlighted in full. **Can CompareText ignore the order of keys in JSON?** Yes, with the Sort keys button on Compare JSON and API Response Diff. It sorts keys alphabetically at every level of both documents, so two objects that differ only in key order show no changes. **Which languages does the site support?** The interface is in English. The tool itself compares text in any language and script. ## Optional - [Word Counter](https://comparetext.org/word-counter/): Count words, characters, sentences and paragraphs. - [Sort Lines](https://comparetext.org/sort-lines/): Sort lines alphabetically or numerically. - [Remove Duplicate Lines](https://comparetext.org/remove-duplicate-lines/): Remove repeated lines from a list. - [Case Converter](https://comparetext.org/case-converter/): Convert text to upper case, lower case, title case, sentence case, camelCase, snake_case and more. - [About](https://comparetext.org/about/): Who makes CompareText and why. - [Privacy Policy](https://comparetext.org/privacy/): What data is stored and when. - [Contact](https://comparetext.org/contact/): How to reach the team.