HTML and web publishing guides

Account for Bytes in a Saved Café Page

·

When a page includes a large amount of inline CSS or embedded data, its HTML can become heavy before other files load. Measure the saved source first to see where those bytes sit and which declarations need separate network evidence.

HTML Page Weight Analyzer

Account for all 385 sample bytes

Load the example and measure it as a complete document. The result shows 385 UTF-8 source bytes. Inline script bodies account for 20 bytes, style element bodies for 14, the style attribute token for 16, and the comment for 12. The remaining 323 bytes are other markup and text.

The accent in Café occupies two UTF-8 bytes and the coffee symbol occupies three. The breakdown measures source slices, so the 20-byte script count includes the original non-ASCII string. An uploaded file’s original byte size appears separately when the file has not been edited.

WHATWG Encoding Standard, UTF-8 encoderWHATWG HTML syntax attributes and comments

Locate the resource attributes and remove the comment

There are four declarations. The stylesheet href is on line 6, the image src and srcset are on line 11, and the external script src is on line 12. The 38-byte srcset token contains two candidates, but the report counts one declaration.

Remove only the 12-character string <!--draft--> and keep its whitespace and line break. Measure again. The total is now 373 bytes, comments contribute zero, and the same four declarations remain.

WHATWG HTML image candidates and source selectionWHATWG HTML external resource links

Compare the export with network evidence

Download the JSON report. The size categories add to sourceBytes. The declaration entries give source positions and token byte sizes. Those tokens are already part of the source total, and the export omits the addresses themselves.

A saved page cannot establish which srcset candidate was chosen, which files were served from cache, or the amount of compression. For those questions, compare with a browser recording from the relevant viewport, cache state and page session.

WHATWG HTML image candidates and source selectionW3C Resource Timing and encoded, decoded and transfer sizes

Common questions

Does an embedded data URL count in the HTML total?

Yes. Supported single-URL data attributes appear in the embedded source category. Candidate lists stay in other markup, while all their bytes count in the total.

Does the analyzer open stylesheet URLs to inspect fonts or images?

The inventory lists source declaration positions only. Stylesheet dependencies and runtime requests require recorded evidence from a browser session.

Sources

Put it into practice.

Related guides