Suggestions
LLMs.txt Lab logo LLMs.txt Lab

llms.txt Merge & Compare Tool

Compare two llms.txt files, review structural and line-by-line changes, resolve conflicts, remove duplicates and merge them into one organized file.

File A (Base)
File B (Newer)

What Is the llms.txt Merge & Compare Tool?

The llms.txt Merge & Compare tool lets you upload or paste two llms.txt files, inspect their differences, resolve conflicts, combine useful content, remove unwanted duplication, and export one final file. It performs comparisons on both the raw text lines and the parsed structural elements of the Markdown.

How the Tool Works

The tool provides two primary modes: Compare Files and Merge Files. In Compare mode, it simply highlights differences between File A and File B. In Merge mode, it additionally applies your chosen merge strategy to build a combined file, presenting any ambiguous differences (like the same link having two different descriptions) as Conflict Cards for you to manually resolve.

How Two llms.txt Files Are Compared

The tool separates comparisons into four levels: Text comparison (raw lines), Structural comparison (project title, summaries, sections), Link comparison (URLs, titles, descriptions), and Order comparison (detecting moved sections or links rather than just deleted/added lines).

Text Comparison vs Structural Comparison

A normal text diff shows exactly which raw lines were modified, which is useful for seeing exact whitespace and syntax changes. A Structural comparison parses the file as an AST (Abstract Syntax Tree), allowing the tool to tell you intelligently that "Section 'Guides' was moved" instead of just showing hundreds of deleted and added lines.

How Sections Are Matched

Sections are matched using exact-name match, case-insensitive match, and whitespace-normalized match. Similar semantic names (like "Docs" vs "Documentation") are not automatically merged to prevent accidentally combining unrelated resources.

How URLs and Descriptions Are Compared

Links are matched primarily by URL. If both files contain the exact same URL but different descriptions, a Conflict is generated. You can then choose to use File A's description, File B's description, or manually write a combined description.

How Duplicate Links Are Handled

Exact duplicates (same title, URL, and description) can be merged automatically. Ambiguous duplicates (like URLs with different tracking parameters or fragments) are flagged for your review so you can consolidate redundant resources safely.

How Merge Conflicts Are Resolved

When merging, any record that was changed differently in both files creates a conflict. The Conflict View displays cards for each issue. You can apply bulk strategies (like "Prefer File A") or resolve them individually by clicking "Use A" or "Use B" before generating the final output.

What Is a Three-Way Merge?

An advanced three-way merge compares two modified versions against their shared original base file. This determines which changes were introduced independently, allowing many conflicts to be resolved automatically (similar to a Git merge). This feature is planned for a future update.

How the Optional Section Is Handled

If a link is classified as core in File A but moved to the ## Optional section in File B, the tool treats this as a priority conflict. The default recommendation is to keep it as a core resource to avoid accidentally deprioritizing important documentation for AI parsers.

How to Merge llms.txt Files Safely

The safest approach is the Conservative merge strategy: preserve all unique content, keep the primary file's order, and manually review all flagged duplicates and conflicts. The tool will never silently discard meaningful information without your approval.

Merge Tool vs Formatter

The Formatter cleans up spacing and syntax in a single file without modifying content. The Merge Tool actively combines the content of two files, identifying duplicate URLs, structural changes, and description edits.

Related Components

Questions you might have

Does the tool change my original files?
No. The source files should remain untouched. The merged result is created as a separate output.
Can I merge more than two files?
Yes. Merge mode can support multiple files, while Compare mode should initially focus on two files.
What happens when both files use different project titles?
The tool should report a title conflict and require the user to choose or enter one final H1.
Are duplicate URLs removed automatically?
Only exact duplicates may be proposed for removal. Possible duplicates should require review.
What happens when the same URL has different descriptions?
The tool should show both descriptions and let the user choose or write a combined version.
Can a link appear in both a core section and Optional?
It can, but the tool should flag it as a priority conflict and ask where the final record belongs.
Does formatting count as a content change?
The tool should identify formatting-only differences separately and allow the user to hide them.
What is a three-way merge?
It compares two changed versions against their shared original file so independent changes can be separated from true conflicts. Git uses the same common-ancestor principle for three-way merging.
Does the tool validate the merged file?
It should perform lightweight validation and allow the result to be opened in the full llms.txt Validator.