XML Splitter — Record Count or File Size
About this tool
Split XML containing repeated row-like elements by record count or output file size. The most frequent repeated element is automatically selected, or you can choose a candidate, root-level records or a manual path. Each output retains the document envelope, attributes, namespaces, metadata, nested values and CDATA. The entire file is validated and actual bytes checked before saving. All processing runs in your browser (no data is sent).
Input file and format
Supported documents
Each repeated XML 1.0 element is one record. Namespaces and shared metadata outside the selection are retained.
Records to split
Examples: /root/items/item, /ns:root/ns:item. XPath predicates are not supported.
Choose a file to see record candidates.
The most frequently repeated element is selected; ties prefer shallower paths. Records must be consecutive siblings under one parent. You can stop a lengthy scan and switch to the root or a manual path.
Supported example: <rows><row id="001"><name>Alice</name></row><row id="002"><name>Bob</name></row></rows>. Nested elements can also be detected. Selected records must be consecutive children of one parent; other data is preserved outside the record group. A different element between records, or matching paths under multiple parents, causes validation to stop. XML 1.0 is supported; DTD and external entities are not.
The detected input format will appear after file selection.
Input preview (encoding and structure)
Only the beginning is shown. Full validation checks the entire file before splitting.
Split limits and output format
Choose a file and review the preview and split settings.
Confirm that the download has finished before continuing. The link for this file will no longer work afterward.
Output results
| File name | Records | Size (bytes) |
|---|
Only the latest 100 files are shown. All output files are available in the chosen destination.
How to use
- Select the XML file, inspect encoding and structure in the preview, and confirm the chosen path and record count. You may select a different candidate or specify a path. The sample chooses
/export/rows/row. - Set the maximum file size or record count according to your import limits. Formatting line breaks do not count as rows.
- Choose an output encoding and saving method, then select Validate and split.
- Folder saving creates a dedicated subfolder, with names such as
original-name_part_000001.xmlnumbered sequentially. In download mode, confirm each file before proceeding.
Processing behavior and limits
- Sizes are calculated from actual uncompressed output files. Multibyte characters count by their actual encoded size. If the document envelope and one record alone exceed the limit, processing stops before saving and reports the required size.
- Each output includes an XML declaration and enclosing ancestor elements, with surrounding shared metadata. The declaration's encoding follows the output choice. Attributes, namespaces, nested elements, CDATA and character references are retained; whitespace inside records is not reformatted.
- Comments and processing instructions before or after the root are preserved. Comments between records attach to the following record; trailing comments are retained. An empty root yields one file preserving its structure. Missing requested paths cause an error; empty inputs produce no output.
- Automatic detection scans the whole input. Splitting then performs three stages: structural validation, size validation and saving. No output is written until the complete file, including its end, passes validation. Shared metadata repeated in outputs is limited to 1 MiB.
- Records are processed without loading the entire file into memory. Each record is limited to 64 MiB, and individual downloads to 128 MiB per output file. For large files, use folder saving in a supported desktop browser.
- On error or cancellation, only the dedicated folder created for this run is deleted. If cleanup fails, its location is shown. Downloads cannot be deleted automatically; discard incomplete results rather than importing them.