Extracting First-Aid and Handling Sections From a Safety Data Sheet
10 min read · updated August 11, 2026
Most document segmentation is guesswork about where one topic ends and another begins. A safety data sheet is not: it has exactly sixteen sections, in one order, by regulation. That turns segmentation into a constraint satisfaction problem with a known answer shape, and it is by far the strongest structural signal in the document.
Sixteen sections, fixed order
The GHS specifies a sixteen-section format, adopted with local wording by national regimes — Annex II of the EU REACH regulation, and Appendix D of the United States hazard communication standard. The order is not a convention; it is the specification.
1 Identification 2 Hazard(s) identification 3 Composition / information on ingredients 4 First-aid measures 5 Fire-fighting measures 6 Accidental release measures 7 Handling and storage 8 Exposure controls / personal protection 9 Physical and chemical properties 10 Stability and reactivity 11 Toxicological information 12 Ecological information 13 Disposal considerations 14 Transport information 15 Regulatory information 16 Other information
The order encodes a priority judgement: the sections a first responder needs come before the ones a regulatory affairs specialist needs. That is worth knowing when you decide what to extract, because sections 4 through 8 are the operationally urgent block and sections 9 through 16 are reference.
Anchor on numbers, not titles
Section titles vary. They vary between regimes, between the singular and plural of “hazard”, between the slash and the word “and”, between title case and upper case, and completely between languages. The number does not vary. So the segmentation should be built on the numbers, with titles used only as corroboration.
The naive version of that fails immediately, because the numeral 4 appears in page footers, in CAS registry numbers, in concentration ranges, in subsection references and in the transport section. What makes it work is the monotonic constraint: the document contains a sequence of sixteen headings whose numbers are 1 through 16 in strictly ascending order, each appearing once, spread across the document in increasing position.
- Find every candidate heading — a line beginning with an integer 1 to 16, optionally preceded by the word “section” in the document’s language, optionally followed by a separator.
- Discard candidates whose number is followed by a further dot and digit; those are subsections and belong to the section above them.
- Find the longest strictly increasing subsequence of candidates by number and by position. On a well-formed sheet this has length sixteen.
- Each section’s content runs from its heading to the next heading in that subsequence.
When the subsequence comes back shorter than sixteen, that is diagnostic rather than fatal: it usually means one heading was rendered as an image, or the page order was disturbed during scanning, and it tells you which section to look at. A pipeline that segments by similarity to expected titles fails silently instead, which is the difference worth having.
Inside sections 4 and 7
The subsection numbering is specified too, and it is the level at which the interesting fields live. Section 4 is divided into a description of first-aid measures, the most important symptoms and effects both acute and delayed, and an indication of any immediate medical attention and special treatment needed. Section 7 is divided into precautions for safe handling, conditions for safe storage including incompatibilities, and specific end uses.
Within the first of those subsections the content is keyed by route of exposure — inhalation, skin contact, eye contact, ingestion — and that keying is a convention rather than a numbered requirement, so the labels move around and are sometimes run into a single paragraph. Extract the route-keyed measures as a list of route and instruction pairs where the routes are identifiable, and preserve the paragraph verbatim where they are not. Splitting prose that was not written as a list is how a measure ends up attached to the wrong route, and for this document that is the worst available outcome.
Section 7’s incompatibilities are the field most often wanted programmatically, because they drive storage segregation decisions. They are free text naming substance classes, they cross-reference section 10 on stability and reactivity, and they are frequently phrased as an exclusion rather than a list. Treat them as text with a link to section 10 rather than as a parsed set of chemicals; the parsed version looks more useful and is confidently incomplete.
Required, and not enforced
A detail that surprises people building validators. Under the United States hazard communication standard, sections 12 through 15 — ecological information, disposal considerations, transport information and regulatory information — must be present in the sheet, but their content falls under other agencies’ jurisdiction and OSHA does not enforce it. The practical consequence is that those four sections on a US-market sheet are routinely thin, sometimes containing only a statement that no data is available, while the equivalent sections on an EU sheet prepared under REACH are substantive.
So an extraction quality metric based on how much content each section yields will rate US sheets as failures. Judge completeness per section against what that section is expected to contain in the regime the sheet was issued for, and detect the regime from section 15 and from the document’s own statements rather than assuming one.
“No data available” is itself a meaningful value and is different from an empty section. The distinction between an explicit absence and a failure to extract matters enough that they should be different values in the output, not both null — the same reasoning that applies to any handling of a missing required field where a blank can mean two things.
Segmentation failures
- Headings inside a table of contents. Some sheets print a contents list on page one containing all sixteen numbered titles in order. That is a perfect false positive for the monotonic search, and it will segment the entire document into the first page. Reject a subsequence whose sixteen headings span less than a page.
- Repeated headings in page headers. The running header may repeat the current section title on every page, producing duplicate numbers out of order. Deduplicate candidates by position band before the subsequence search.
- Two-column layouts. A two-column sheet has a reading order that is not the coordinate order, and section 9 can appear before section 5 in a naive text stream. This is a layout problem rather than a prompting one and belongs to the reading-order machinery; solve it before the segmentation runs, not after.
- Section 16 has no successor. The last section runs to the end of the document, which includes any appendix, revision history, legend of abbreviations and legal disclaimer. Those are worth separating, because the revision date of the sheet often lives there and it is the field that decides whether your record is current.
- Multi-product sheets. A single file occasionally contains several sheets concatenated, one per product. The monotonic search then finds a valid run of sixteen and stops, silently ignoring the rest. Continue searching after section 16 and expect further complete runs.