How CompareStack works
This page describes the behavior implemented in the application. It is the reference for what a result means, and for what the tools deliberately do not do.
1. Choose a tool
Each tool has its own URL and form. Paste tools accept text. File tools accept two uploads. Nothing runs until you submit the form.
2. Provide input
- Pasted text is limited to 100,000 characters per field on the paste-based tools.
- Each uploaded file is limited to 10 MB. PDF uploads must be PDF. Word uploads must be DOC or DOCX. Spreadsheet uploads must be XLS, XLSX, or CSV.
- Forms include a CSRF token. Paste endpoints are rate limited to 30 requests per minute per IP. Upload endpoints are limited to 10 per minute per IP.
3. Processing
Work runs on the server for that request. File tools read the PHP temporary upload path for the request. The application does not copy uploads into a user account, a document database, or a personal file library. PHP removes an uploaded temporary file at the end of the request when the application has not moved it. CompareStack does not move these uploads into storage.
The application can write operational logs. Excel comparison failures are logged with the exception message for troubleshooting. Extraction failures for PDF, Word, and Excel are logged the same way. Those logs are not a copy of your document, but server logs can still contain technical metadata such as IP address and URL. See the Privacy Policy.
4. Comparison and formatting
Comparison tools build a line diff. Matching lines stay unmarked. Lines only on the first side are removed. Lines only on the second side are added. A removed line immediately followed by an added line is shown as a changed pair, with word-level highlights inside that pair. Very large file comparisons (more than 250,000 line-pairs in the alignment grid) use a simpler fallback diff instead of the full alignment.
5. Results
The result is rendered in the same browser response. There is no account dashboard and no saved comparison history in the application.
6. Limits that apply to every file compare
If extracted text from one file is larger than about 3 MB, that comparison is rejected with a message asking you to use a smaller file. Extraction errors are shown as a short message in the result. The underlying exception text is not displayed.
How Text Compare works
Both sides are split on any newline (CRLF or LF). Lines are aligned with a longest-common-subsequence diff. Changed lines also get an inline highlight split on whitespace. CRLF versus LF does not, by itself, mark every line changed. Trailing spaces do.
Example:
name=John
status=active
plan=basic
compared with
name=John
status=active
plan=premium
The first two lines match. The plan line is shown as changed, with basic and premium highlighted.
How PDF Compare works
PDF Compare uses a PDF text parser to read selectable text, then compares that text. Before diffing, it normalizes spaces and rejoins line wraps, then splits sentences on . ! ? ; so wrapped lines do not all look like edits.
This tool compares extracted text. It is not a pixel-level visual PDF comparison. It does not run OCR. A scanned PDF with no text layer can produce an empty or failed extraction.
How Word Compare works
Word Compare loads DOC/DOCX with a document library and collects paragraph and table text. If that pass is empty, DOCX files are read from word/document.xml inside the Office zip package.
It does not read Track Changes authors, comments, or formatting. A style-only change with the same words will not appear as a diff.
How Excel Compare works
CSV rows are read with a CSV parser. XLS and XLSX workbooks are read sheet by sheet. Each sheet starts with a [Sheet] line. Cells in a row are joined with | . Empty cells become ∅. Blank rows are skipped. Each sheet stops after 1,200 data rows and adds a truncation note.
Rows stay as rows (they are not reflowed into sentences). The parser supplies cell values, not a visual grid and not an audit of formula logic.
How the JSON formatter works
The server decodes the paste as JSON. Invalid JSON, including trailing commas, is rejected with the parser error. Valid JSON is pretty-printed with Unicode and slashes left unescaped. The tool does not repair malformed JSON for you. After formatting, Text Compare is the way to diff two payloads.
How the SQL formatter works
The formatter collapses whitespace, uppercases a fixed keyword list, and inserts line breaks before clauses such as SELECT, FROM, WHERE, and JOIN. It is not a parser for PostgreSQL, T-SQL, or any other dialect, and it does not give WITH clauses a special layout. Always read the result before running it.
How the code formatter works
HTML-like input is indented with PHP’s DOM formatter when that succeeds. Other input gets a brace-and-bracket indentation pass. It is not a language formatter for a named list of languages, and it is not a substitute for Prettier, Black, or gofmt.
How URL encode and decode works
Encode uses PHP rawurlencode (spaces become %20, not +). Decode uses rawurldecode. The tool encodes or decodes the whole paste. It does not split a URL into query parameters for you.
How Base64 works
Encode uses standard Base64 (+, /, and = padding). Decode strips whitespace and requires valid standard Base64. If the decoded bytes are not valid UTF-8, the tool shows hexadecimal instead of garbled text.
This is encoding, not encryption. URL-safe Base64 (JWT-style - and _) is not translated automatically. Convert those characters and restore padding before decoding here.
Browse the tools or read the changelog.