📚 HTML Attribute Extractor
Extract element names and attributes from pasted HTML snippets. Runs in your browser.
Last updated: November 8, 2026 · By the BoltQuickTools team
List every attribute in a block of HTML
Reviewing a template or a pasted third-party snippet by eye is slow, especially when you only want to know which classes, data attributes or links it uses. This page reduces markup to one line per element, using the browser's DOMParser. Scripts in the snippet do not run while it is being parsed, and the page's code does not send it anywhere.
Using it
Paste into HTML Snippet and the Attributes box updates as you type. Extract reruns it, Copy Attributes copies the list, Load Sample fills in an example and Clear empties both boxes. The line below the buttons gives the element count.
Sample input and output
<a href="/docs" class="primary" data-track>Docs</a>
<button type="button" aria-label="Open menu">Menu</button>
Produces:
a: href="/docs", class="primary", data-track=""
button: type="button", aria-label="Open menu"
Values are quoted the way JSON quotes strings. A valueless attribute shows as an empty string, and a double quote inside a value is written with a backslash, so value="say "hi"" appears as value="say \"hi\"".
What gets left out
The results reflect how a browser parses the snippet, which can surprise you:
- Only elements inside the body are listed. On a full page,
html,head,bodyand everything in the head are skipped. A snippet of<!doctype html><html lang="en"><head><meta charset="utf-8"></head><body class="b"><p id="x">t</p>reports onlyp: id="x". - A
linkormetatag at the very start of a fragment is moved to the head by the parser and disappears from the list. - Elements with no attributes are not listed, and the count covers only the ones shown.
- Content inside a
templateelement is not walked. - Names are lowercased, except that SVG attributes such as
viewBoxkeep their case. If an attribute is repeated, the first one wins:class=a CLASS=zkeepsa. - Entities are decoded, so
class=a&breportsa&b.
Questions you may have
Is it safe to paste HTML I do not trust?
Nothing in the snippet executes. Event attributes are just text in the list: <span onclick="alert(1)"> reports span: onclick="alert(1)". That also makes this a quick way to spot inline handlers in copied code.
Can I extract just one attribute, such as every href?
The page has no filter. Copy the list and search or filter it in your editor.
Which page should I use for other clean-up?
To indent the markup, use the HTML beautifier. To remove the tags and keep only the text, use the HTML tag stripper. To convert the attributes to React names, use HTML to JSX.