Stratified Data Splitter

Stratified Data Splitter

Reproducible CSV splitting with visible group isolation and label balance.

UTF-8 · up to 1 MiB, 5,000 rows, 32 columns and 100 labels. Processing stays in your browser.

Source CSV

Load the example or enter a CSV.

Comments & questions

Stratified Data Splitter

A model evaluation can look better than it is when rows from the same person or household appear in both training and validation. Choose an optional label and group column, enter a seed and proportions, and assign every input row exactly once. Group members stay together; the result shows where indivisible groups prevent ideal balance.

Key features

  • The same seed, original row order, columns and percentages reproduce the assignment.
  • With a label column and no group column, each label is split separately; rare labels receive explicit warnings.
  • With a group column, every row of a group remains in one partition and actual-versus-target deviations are shown.
  • Export train, validation and test CSV files, a full input-record assignment CSV and a reproducibility JSON report.
  • Strict UTF-8 CSV/TSV parsing preserves quoted line breaks; CSV exports protect spreadsheet-like formulas.

How to use

  1. Paste a headed CSV or choose a UTF-8 file and inspect the columns.
  2. Optionally choose a target label column and a subject/group column.
  3. Enter train, validation and test percentages totaling 100, plus a seed, then run the split.
  4. Inspect actual partition sizes, label distributions and warnings.
  5. Download each partition CSV and the assignment and JSON reports to compare with the source.

Use cases

  • Keep a customer's transaction rows together by grouping on customer ID.
  • Preserve class proportions as far as the selected grouping permits in a small classification experiment.
  • See an explicit warning when one large group makes an intended percentage impossible.
  • Share a seed and original row-order contract so a teammate can reproduce the same split.

Frequently asked questions

Does it perfectly satisfy both stratification and group isolation?

Group isolation is enforced, while percentages and label balance are heuristic targets. An indivisible group can make exact counts or class coverage impossible. Inspect the shown deviations and missing-label warnings.

Is the same seed alone enough to reproduce a split?

Use the same CSV text and row order, selected columns, percentages and seed. Changing row order or group spelling can change the result. The pseudorandom generator is not cryptographic.

How is this different from the random generator?

The random generator produces values. This tool partitions every supplied CSV row into disjoint datasets, keeps groups together and reports class distributions.

Does the CSV leave my browser?

Input and splitting run in page memory. Downloaded CSV and JSON files can contain the original rows, so review them before sharing elsewhere.

Privacy

The selected CSV and seed are processed in this page's memory and are not automatically uploaded or stored. Downloaded partitions and JSON can contain source rows and selected labels or groups.

Related Tools

Mock Data GeneratorJSON ↔ CSVRandom GeneratorWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphState Machine TesterPetri Net SimulatorGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerGeoJSON Map EditorPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript Minifier.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderJSON FormatterURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →