Split by structure
Cut at headings, at any CSS selector or at your own comment markers, or into equal parts that never break an element.
Split an HTML file into multiple pages by heading, CSS selector, marker or equal parts, directly in your browser.
or drag and drop one .html, .htm or .xhtml file here
Cut at headings, at any CSS selector or at your own comment markers, or into equal parts that never break an element.
Every part keeps the original head, styles and wrapper elements, with optional Previous, Contents and Next links.
In-document #anchor links are pointed at the part that holds the target, and every file is re-parsed before you download it.
Your original file is not changed; the parts are new files.
Choose or drop one .html, .htm or .xhtml file up to 50 MB, paste HTML, or try the sample file.
Pick a heading level, a CSS selector, a comment marker or a number of equal parts. Part counts update live.
Keep the head and CSS, add navigation links, rewrite anchors and set the file name pattern.
Check each part in a sandboxed preview, then download single files or everything as a ZIP.
Want the opposite? The HTML Merger combines several HTML files into one page, and works well for rejoining parts you split here.
No. Your browser reads the file, parses it with its own HTML parser and builds every part and the ZIP locally. There is no upload, no account, and nothing is stored after you close the page.
Yes, when the parts stay together in one folder. Each part keeps the original <style> blocks, stylesheet links and wrapper elements, and #anchor links are rewritten to the right part. Relative image and CSS paths are copied as written.
An HTML splitter takes one long HTML document and turns it into several smaller ones. That sounds simple, but HTML is a tree of nested elements, not a list of lines. If you cut a file at line 5,000 the way you would split a log file, you almost always end up in the middle of a <div>, a table or a paragraph, and both halves are broken. A proper split happens between elements, keeps the document structure around each piece, and gives every part what it needs to display correctly on its own.
HTML has six heading levels, <h1> to <h6>, described in the MDN guide to heading elements. A well-written document uses them like an outline. The title is usually the only H1, chapters are H2 and sections within a chapter are H3. The WHATWG HTML Living Standard defines how these elements and the sectioning elements (<section>, <article>) fit together.
That is why splitting by heading works so well: each heading marks the start of a unit a reader would treat as a page. The tool counts the H1, H2 and H3 elements when you load a file and picks the highest level that appears at least twice. A document with one H1 title and eight H2 chapters is split into chapters, not into a single page. Exported documents do not always follow the rules, though. Some use bold paragraphs instead of headings, or skip from H1 to H4. If the counts look wrong, check the source or try another mode.
section, article, div.page or .chapter. A selector of hr splits at every horizontal rule, which many older pages use as a section break.<!-- split --> to the source wherever you want a break. Comments are invisible in browsers, so the marker does no harm if it stays in the original.CSS. With Keep <head> on, every part gets a copy of the original head: inline <style> blocks, stylesheet <link> elements, the viewport tag and other meta tags. The output is always UTF-8, so the charset is set to UTF-8 even if the source used windows-1252 or UTF-16. The tool also recreates the wrapper elements around each part. If your chapters sit inside <main class="content">, every part has that same wrapper, so a rule like .content p still applies.
Scripts. Scripts are left out by default. A script written for the full page often looks for elements that are now in another file, and copying it into twenty parts makes it run twenty times. If your pages depend on JavaScript, turn the option on and test the parts in a browser.
Links. A table of contents that links to #installation breaks once the Installation section moves to another file. The tool records which part contains every id and rewrites those links to guide-03-installation.html#installation. Relative links to images, stylesheets and other pages are copied exactly as written, so keep the parts in the same folder as the original assets.
For a small file you can split HTML manually. Open it in a code editor, copy the head, and paste it with each section into a new file. That works for three sections, but not for forty, and fixing anchor links by hand is slow. A good editor helps; see our guides to the best HTML editors for Linux and the best HTML editors for Android.
Older command-line tools such as Splity, htmlsplit and htsplit split HTML at markers or headings, but they are Perl scripts from the early 2000s that need a Perl install and expect tidy, predictable markup. Writing your own script in Python with BeautifulSoup or lxml is the most flexible route: parse the file, find the headings, and move siblings into new documents. It also means handling nested wrappers, copying the head, fixing anchors and naming files yourself. Library splitters built for AI pipelines, such as LangChain's header splitter, return text chunks for embeddings rather than HTML pages you can publish.
This tool does that work in the browser. It uses the browser's own HTML parser, so messy real-world markup is read the same way a browser displays it. It shows how many parts each mode would create before you commit, and re-parses every output file to check that no text was lost.
Download everything as a ZIP and extract it into the folder that holds the original file, so relative images and stylesheets resolve. If navigation is on, index.html is the entry point and every part links back to it. Choose a file name pattern before you split, because renaming files later breaks the rewritten links. The default {name}-{n}-{slug}.html keeps parts in reading order in any file browser and gives search engines a readable URL. For a website, also give each part a unique meta description after splitting, since every part starts with a copy of the original one. To undo a split, add the parts in order to the HTML Merger.
p.Heading1, or add split markers.The same idea, split by structure rather than by line, applies to other formats. The XML File Splitter divides XML by element, the JSON File Splitter splits large JSON arrays, and the TXT File Splitter handles plain text by lines or size. If your source starts life as Markdown, it is often easier to keep chapters as separate files and combine them with the Markdown Merger when you need one document. For more HTML tools, see the HTML format page.
Rejoin pages, split other formats, or browse every HTML tool.