W3C Validator
App · 5 actions
Check web pages for mistakes in their code with the World Wide Web Consortium's free validators: find HTML, XHTML and SVG errors with the Nu Html Checker and CSS errors with the CSS Validation Service, for a public page by its address or for code made in a workflow, each message with its line and a link to the full report. No account or API key required.
Actions
| Action | What it does |
|---|---|
| Check a page's CSS | Check the CSS of a public web page (every style sheet it links and its style attributes), or of one style sheet, with W3C's CSS Validation Service: whether it is valid, how many errors and warnings it has, and each message with its line, selector and style sheet. |
| Check a page's HTML | Check the HTML of a public web page against the web's standards with W3C's Nu Html Checker: whether it is valid, how many errors and warnings it has, and each message with its line, column and the code it is about, plus a link to the full report. |
| Check a page's HTML and CSS | Check a public web page's HTML and its CSS in one step, with W3C's Nu Html Checker and CSS Validation Service: whether both are valid, the errors and warnings in each, and links to both full reports. |
| Check CSS code | Check CSS you provide, pasted in or made in an earlier step, with W3C's CSS Validation Service: whether it is valid for the CSS level you choose, and each error and warning with its line and selector. |
| Check HTML markup | Check HTML you provide, such as a page or email template made in an earlier step or one that isn't public yet, with W3C's Nu Html Checker. |
Check a page's CSS
Check the CSS of a public web page (every style sheet it links and its style attributes), or of one style sheet, with W3C's CSS Validation Service: whether it is valid, how many errors and warnings it has, and each message with its line, selector and style sheet.
Inputs
- Page or style sheet address
urltextRequired - The full address of a public web page, whose style sheets and style attributes are all checked, or of one style sheet (a .css file). W3C's servers fetch it, so it must open without signing in.
- CSS profile
profiletext - The CSS standard to check against. CSS level 3 + SVG covers today's CSS and is what W3C's own form uses.One of:
css3svg(CSS level 3 + SVG),css3(CSS level 3),css21(CSS level 2.1),css2(CSS level 2),css1(CSS level 1),svg,svgbasic(SVG Basic),svgtiny(SVG Tiny),mobile,atsc-tv(ATSC TV),tv. Default:css3svg. - Medium
mediumtext - The kind of device the CSS is for, as in an @media rule. All media checks it for every device.One of:
all(All media),screen(Screens),print,speech(Speech (screen readers)),handheld(Handheld devices),projection(Projectors),tv,braille(Braille displays),embossed(Braille printers),tty(Text terminals). Default:all. - Warnings
warning_leveltext - How many warnings to report: things that are valid but may not work as expected, such as a font list with no generic family.One of:
1(Normal),2(All warnings),0(Only the most important),no(No warnings). Default:1. - Most messages to list
max_messagesnumber - The most messages to list, errors first. The counts always cover the whole report.From 1 to 1000. Default:
100.
Outputs
checkedtrue/false- Whether the checker could read the whole document. When it could not (the page is missing or unreachable, for example), problem says why
error_countnumber- How many errors the checker found
mediumtext- The medium the CSS was checked for, such as all or print
message_countnumber- How many messages are listed in messages
messageslist- The messages: errors first, then warnings, each in the order the checker found them
problemtext- Why the document could not be checked, or empty when it was
profiletext- The CSS profile the CSS was checked against, such as CSS level 3 + SVG
report_urltext- A link to the same check on the CSS Validation Service, to open in a browser
total_message_countnumber- How many messages matched what you asked to include, before the 'Most messages to list' limit
urltext- The address that was checked
validtrue/false- Whether the CSS is valid for the chosen profile: the checker read all of it and found no errors
warning_countnumber- How many warnings the checker found at the warning level asked for, whether listed or not
Example output
{
"checked": true,
"error_count": 2,
"medium": "all",
"message_count": 3,
"messages": [
{
"line": 201,
"message": "Property \u201cinterpolate-size\u201d doesn't exist",
"selector": "html",
"stylesheet": "https://www.w3.org/assets/website-2021/styles/core.css?ver=1.6",
"type": "error"
},
{
"line": 218,
"message": "\u201cauto\u201d is not a \u201ctext-decoration-skip\u201d value",
"selector": "body",
"stylesheet": "https://www.w3.org/assets/website-2021/styles/core.css?ver=1.6",
"type": "error"
},
{
"line": 250,
"message": "The property \u201cclip\u201d is deprecated",
"selector": null,
"stylesheet": "https://www.w3.org/assets/website-2021/styles/advanced.css?ver=1.6",
"type": "warning"
}
],
"problem": null,
"profile": "CSS level 3 + SVG",
"report_url": "https://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fwww.w3.org%2F&profile=css3svg&usermedium=all&warning=1&lang=en",
"total_message_count": 55,
"url": "https://www.w3.org/",
"valid": false,
"warning_count": 53
}Check a page's HTML
Check the HTML of a public web page against the web's standards with W3C's Nu Html Checker: whether it is valid, how many errors and warnings it has, and each message with its line, column and the code it is about, plus a link to the full report.
Inputs
- Page address
urltextRequired - The full address of a public web page, such as https://www.w3.org/. W3C's servers fetch it, so it must open without signing in.
- Include warnings
include_warningstrue/false - List warnings as well as errors: things the standard allows but that are probably a mistake. They are counted either way.Default:
true. - Include info messages
include_infotrue/false - Also list info messages: notes that need no change, such as a slash at the end of a meta tag. They are counted either way.Default:
false. - Most messages to list
max_messagesnumber - The most messages to list, errors first. The counts always cover the whole report.From 1 to 1000. Default:
100.
Outputs
checkedtrue/false- Whether the checker could read the whole document. When it could not (the page is missing or unreachable, for example), problem says why
error_countnumber- How many errors the checker found
info_countnumber- How many info messages the checker gave, whether listed or not
languagetext- The language the checker detected the page is written in, as a language tag such as en or fr
message_countnumber- How many messages are listed in messages
messageslist- The messages: errors first, then warnings, then info messages, each in the order they appear in the document
problemtext- Why the document could not be checked, or empty when it was
report_urltext- A link to the same check on validator.w3.org, to open in a browser
total_message_countnumber- How many messages matched what you asked to include, before the 'Most messages to list' limit
urltext- The address that was checked
validtrue/false- Whether the HTML is valid: the checker read all of it and found no errors
warning_countnumber- How many warnings the checker found, whether listed or not
Example output
{
"checked": true,
"error_count": 0,
"info_count": 30,
"language": "en",
"message_count": 2,
"messages": [
{
"column": 17,
"end_column": 102,
"end_line": 97,
"extract": " <img src=\"https://www.w3.org/assets/logos/w3c-2025/svg/w3c.svg\" alt=\"W3C\" role=\"img\"/>\n ",
"fatal": false,
"highlight": "<img src=\"https://www.w3.org/assets/logos/w3c-2025/svg/w3c.svg\" alt=\"W3C\" role=\"img\"/>",
"line": 97,
"message": "The \u201cimg\u201d role is unnecessary for element \u201cimg\u201d.",
"type": "warning"
},
{
"column": 1,
"end_column": 23,
"end_line": 6,
"extract": "</title>\n\n<meta charset=\"utf-8\"/>\n<meta",
"fatal": false,
"highlight": "<meta charset=\"utf-8\"/>",
"line": 6,
"message": "Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.",
"type": "info"
}
],
"problem": null,
"report_url": "https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.w3.org%2F",
"total_message_count": 31,
"url": "https://www.w3.org/",
"valid": true,
"warning_count": 1
}Check a page's HTML and CSS
Check a public web page's HTML and its CSS in one step, with W3C's Nu Html Checker and CSS Validation Service: whether both are valid, the errors and warnings in each, and links to both full reports.
Inputs
- Page address
urltextRequired - The full address of a public web page, such as https://www.w3.org/. W3C's servers fetch it, so it must open without signing in.
- Include warnings
include_warningstrue/false - Report warnings as well as errors: things the standards allow but that are probably a mistake.Default:
true. - CSS profile
profiletext - The CSS standard to check against. CSS level 3 + SVG covers today's CSS and is what W3C's own form uses.One of:
css3svg(CSS level 3 + SVG),css3(CSS level 3),css21(CSS level 2.1),css2(CSS level 2),css1(CSS level 1),svg,svgbasic(SVG Basic),svgtiny(SVG Tiny),mobile,atsc-tv(ATSC TV),tv. Default:css3svg. - Most messages to list
max_messagesnumber - The most messages to list for each of the HTML and the CSS, errors first. The counts always cover the whole report.From 1 to 1000. Default:
100.
Outputs
checkedtrue/false- Whether both checkers could read the page
cssobject- The CSS check of the page's style sheets and style attributes
error_countnumber- How many errors the two checkers found together
htmlobject- The HTML check
urltext- The address that was checked
validtrue/false- Whether both the page's HTML and its CSS are valid
warning_countnumber- How many warnings the two checkers found together
Example output
{
"checked": true,
"css": {
"checked": true,
"error_count": 2,
"medium": "all",
"message_count": 3,
"messages": [
{
"line": 201,
"message": "Property \u201cinterpolate-size\u201d doesn't exist",
"selector": "html",
"stylesheet": "https://www.w3.org/assets/website-2021/styles/core.css?ver=1.6",
"type": "error"
},
{
"line": 218,
"message": "\u201cauto\u201d is not a \u201ctext-decoration-skip\u201d value",
"selector": "body",
"stylesheet": "https://www.w3.org/assets/website-2021/styles/core.css?ver=1.6",
"type": "error"
},
{
"line": 250,
"message": "The property \u201cclip\u201d is deprecated",
"selector": null,
"stylesheet": "https://www.w3.org/assets/website-2021/styles/advanced.css?ver=1.6",
"type": "warning"
}
],
"problem": null,
"profile": "CSS level 3 + SVG",
"report_url": "https://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fwww.w3.org%2F&profile=css3svg&usermedium=all&warning=1&lang=en",
"total_message_count": 55,
"valid": false,
"warning_count": 53
},
"error_count": 2,
"html": {
"checked": true,
"error_count": 0,
"info_count": 30,
"language": "en",
"message_count": 1,
"messages": [
{
"column": 17,
"end_column": 102,
"end_line": 97,
"extract": " <img src=\"https://www.w3.org/assets/logos/w3c-2025/svg/w3c.svg\" alt=\"W3C\" role=\"img\"/>\n ",
"fatal": false,
"highlight": "<img src=\"https://www.w3.org/assets/logos/w3c-2025/svg/w3c.svg\" alt=\"W3C\" role=\"img\"/>",
"line": 97,
"message": "The \u201cimg\u201d role is unnecessary for element \u201cimg\u201d.",
"type": "warning"
}
],
"problem": null,
"report_url": "https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.w3.org%2F",
"total_message_count": 1,
"valid": true,
"warning_count": 1
},
"url": "https://www.w3.org/",
"valid": false,
"warning_count": 54
}Check CSS code
Check CSS you provide, pasted in or made in an earlier step, with W3C's CSS Validation Service: whether it is valid for the CSS level you choose, and each error and warning with its line and selector.
Inputs
- CSS
csstextRequired - The CSS to check, as it would be in a style sheet. Line numbers in the results count from its first line.
- CSS profile
profiletext - The CSS standard to check against. CSS level 3 + SVG covers today's CSS and is what W3C's own form uses.One of:
css3svg(CSS level 3 + SVG),css3(CSS level 3),css21(CSS level 2.1),css2(CSS level 2),css1(CSS level 1),svg,svgbasic(SVG Basic),svgtiny(SVG Tiny),mobile,atsc-tv(ATSC TV),tv. Default:css3svg. - Medium
mediumtext - The kind of device the CSS is for, as in an @media rule. All media checks it for every device.One of:
all(All media),screen(Screens),print,speech(Speech (screen readers)),handheld(Handheld devices),projection(Projectors),tv,braille(Braille displays),embossed(Braille printers),tty(Text terminals). Default:all. - Warnings
warning_leveltext - How many warnings to report: things that are valid but may not work as expected, such as a font list with no generic family.One of:
1(Normal),2(All warnings),0(Only the most important),no(No warnings). Default:1. - Most messages to list
max_messagesnumber - The most messages to list, errors first. The counts always cover the whole report.From 1 to 1000. Default:
100.
Outputs
checkedtrue/false- Whether the checker could read the whole document. When it could not (the page is missing or unreachable, for example), problem says why
error_countnumber- How many errors the checker found
mediumtext- The medium the CSS was checked for, such as all or print
message_countnumber- How many messages are listed in messages
messageslist- The messages: errors first, then warnings, each in the order the checker found them
problemtext- Why the document could not be checked, or empty when it was
profiletext- The CSS profile the CSS was checked against, such as CSS level 3 + SVG
report_urltext- A link to the same check on the CSS Validation Service, to open in a browser. Empty when the CSS is too long to fit in a link
total_message_countnumber- How many messages matched what you asked to include, before the 'Most messages to list' limit
validtrue/false- Whether the CSS is valid for the chosen profile: the checker read all of it and found no errors
warning_countnumber- How many warnings the checker found at the warning level asked for, whether listed or not
Example output
{
"checked": true,
"error_count": 2,
"medium": "all",
"message_count": 4,
"messages": [
{
"line": 1,
"message": "Property \u201ccolr\u201d doesn't exist. The closest matching property name is \u201ccolor\u201d",
"selector": "body",
"stylesheet": null,
"type": "error"
},
{
"line": 2,
"message": "\u201c#12345\u201d is not a valid color 3 or 6 hexadecimals numbers",
"selector": "p",
"stylesheet": null,
"type": "error"
},
{
"line": 2,
"message": "\u201cfont-family\u201d: You are encouraged to offer a generic family as a last alternative",
"selector": "p",
"stylesheet": null,
"type": "warning"
},
{
"line": 3,
"message": "\u201c-webkit-transition\u201d is a vendor extension",
"selector": null,
"stylesheet": null,
"type": "warning"
}
],
"problem": null,
"profile": "CSS level 3 + SVG",
"report_url": "https://jigsaw.w3.org/css-validator/validator?text=body+%7B+colr%3A+red%3B+margin%3A+0+%7D%0Ap+%7B+color%3A+%2312345%3B+font-family%3A+Arial+%7D%0A.a+%7B+-webkit-transition%3A+all+1s+%7D%0A&profile=css3svg&usermedium=all&warning=2&lang=en",
"total_message_count": 4,
"valid": false,
"warning_count": 2
}Check HTML markup
Check HTML you provide, such as a page or email template made in an earlier step or one that isn't public yet, with W3C's Nu Html Checker. XHTML and SVG work too. Gives whether it is valid and each error and warning with its line and column.
Inputs
- HTML
markuptextRequired - The markup to check, from <!DOCTYPE html> to the end, pasted in or from an earlier step. Line numbers in the results count from its first line.
- Markup type
markup_typetext - How to read the markup. Detect reads it as XML when it starts with an <?xml declaration or an <svg> or <math> element, and as HTML otherwise.One of:
auto(Detect from the markup),html,xml(XHTML, SVG or other XML). Default:auto. - Include warnings
include_warningstrue/false - List warnings as well as errors: things the standard allows but that are probably a mistake. They are counted either way.Default:
true. - Include info messages
include_infotrue/false - Also list info messages: notes that need no change, such as a slash at the end of a meta tag. They are counted either way.Default:
false. - Most messages to list
max_messagesnumber - The most messages to list, errors first. The counts always cover the whole report.From 1 to 1000. Default:
100.
Outputs
checkedtrue/false- Whether the checker could read the whole document. When it could not (the page is missing or unreachable, for example), problem says why
error_countnumber- How many errors the checker found
info_countnumber- How many info messages the checker gave, whether listed or not
languagetext- The language the checker detected the page is written in, as a language tag such as en or fr
markup_typetext- How the markup was read: HTML, or XML (XHTML, SVG and other XML)
message_countnumber- How many messages are listed in messages
messageslist- The messages: errors first, then warnings, then info messages, each in the order they appear in the document
problemtext- Why the document could not be checked, or empty when it was
total_message_countnumber- How many messages matched what you asked to include, before the 'Most messages to list' limit
validtrue/false- Whether the HTML is valid: the checker read all of it and found no errors
warning_countnumber- How many warnings the checker found, whether listed or not
Example output
{
"checked": true,
"error_count": 5,
"info_count": 0,
"language": null,
"markup_type": "HTML",
"message_count": 3,
"messages": [
{
"column": 18,
"end_column": 21,
"end_line": 5,
"extract": "o <b>world</p>\n<img ",
"fatal": false,
"highlight": "</p>",
"line": 5,
"message": "End tag \u201cp\u201d seen, but there were open elements.",
"type": "error"
},
{
"column": 1,
"end_column": 17,
"end_line": 6,
"extract": "world</p>\n<img src=\"a.png\">\n<sect",
"fatal": false,
"highlight": "<img src=\"a.png\">",
"line": 6,
"message": "An \u201cimg\u201d element must have an \u201calt\u201d attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.",
"type": "error"
},
{
"column": 16,
"end_column": 6,
"end_line": 2,
"extract": "TYPE html>\n<html>\n<head",
"fatal": false,
"highlight": "\n<html>",
"line": 1,
"message": "Consider adding a \u201clang\u201d attribute to the \u201chtml\u201d start tag to declare the language of this document.",
"type": "warning"
}
],
"problem": null,
"total_message_count": 7,
"valid": false,
"warning_count": 2
}