How to Use HTML Viewer to Inspect HTML Text
Enter HTML, select source or preview, and compare the returned text forms with the character and newline-separated segment counts. An empty field is handled successfully, and source is the default mode.
Inspect markup without losing its text context
HTML Viewer is useful when you need to examine markup as text rather than rely on how a page appears. It gives you two ways to inspect non-empty HTML. Source mode returns an escaped representation, making characters used by the markup visible in the returned text. Preview mode returns the HTML you supplied together with that escaped representation, so you can compare the original text with its escaped form in one response.
The tool also reports the number of characters and the number of newline-separated segments in non-empty source and preview requests. Those values can help you check whether the text you submitted has the expected length and line structure. This makes the tool suitable for checking a short fragment, reviewing a copied snippet, or comparing formatting before you work with a larger piece of markup.
The word preview refers to the returned text representations in this tool. The reviewed behavior does not establish that the markup is rendered or executed as it would be in a browser, so read the response as text output and counts.
Work through an HTML text check
-
Prepare the HTML you want to examine. You can enter a complete document or a smaller fragment, such as a paragraph, heading, or link. The HTML field is optional, so leaving it empty supplies an empty value instead of requiring text before the request can be handled.
-
Choose source when the escaped form is your main focus. For non-empty input, this mode returns an escaped representation of the supplied HTML. This is useful when you want to read markup characters as text and distinguish them from the surrounding response.
-
Choose preview when you need the supplied HTML and its escaped representation together. For non-empty input, the response contains both forms, allowing you to compare what you entered with how the markup is represented as escaped text. This option does not change the supplied snippet into a browser view.
-
Leave the mode unselected if source is the appropriate choice. Mode is optional, and source is used by default. If you want a different behavior, select one of the two supported choices before running the request rather than relying on an unspecified value.
-
Run the tool and inspect the returned content. In source mode, look for the escaped representation. In preview mode, distinguish the supplied HTML from the escaped representation so that you know which text reflects your input and which text shows the escaped form.
-
Review the counts alongside the returned text when the input is non-empty. One count represents characters in the supplied HTML, while the other represents newline-separated segments. If line structure matters, compare the segment count with the line breaks in the text you entered; do not treat that value as a rendering measurement.
-
Replace the snippet and run another request when you want to examine a different fragment. Keep the selected mode as source or preview. Choosing another mode produces an error response, so changing the HTML alone is not enough if the mode has also been changed to an unsupported value.
Understand what the response tells you
An empty submission is handled successfully with empty content rather than entering source or preview processing. For non-empty input, source mode is useful when the escaped representation is the main thing you need to read. Preview mode adds the supplied HTML to that escaped representation, so it is useful when you want both forms in one response.
The counts describe the supplied HTML: one value is the number of characters, and the other is the number of newline-separated segments. They are output details, not a claim that the markup has been rendered or executed. In particular, the verified behavior covers text representations and counts; it does not establish browser rendering, sanitization, or a security review.
Worked example
A developer checks a short paragraph to compare its original text with the escaped form before examining a larger snippet.
Enter <p>Hello</p> as the HTML input, select preview, and run the tool. Compare the supplied paragraph with its escaped representation, then review the two reported counts.
The response contains the supplied HTML, an escaped representation, a character count, and a count of newline-separated segments, without asserting particular numeric values.
Limitations
- The returned forms are text representations; the reviewed behavior does not establish browser rendering, HTML execution, sanitization, or security checking.
Common errors
- An unsupported mode causes the error response; select source or preview and submit the HTML again.
FAQ
What happens if I leave the HTML field blank?
The request is handled successfully with empty content, rather than entering the source or preview processing branch, when the HTML field has no value.
Which mode is selected by default?
Source is used when no mode is selected, and non-empty input then receives an escaped representation of the supplied HTML.
Does preview mode render the HTML?
Preview returns the supplied HTML together with an escaped representation, so the reviewed behavior describes text output rather than browser rendering or HTML execution.