Mobile Website Preview
Paste a page's HTML and CSS and see it at phone, tablet and laptop widths at the same time. The preview also flags a missing viewport tag, the most common reason a site looks tiny on phones. Everything runs in your browser.
Preview your page at three widths
Paste a complete page, or a fragment with its CSS in a style block, then select Preview. Scroll inside each frame to see the rest of the page.
Scripts do not run here, and only https images, stylesheets and fonts load, so relative file paths will not resolve. The frames show layout at each width; they do not reproduce touch input, browser toolbars or screen density, so check important pages on a real phone too.
What a side-by-side preview shows
Most layout bugs on phones are width bugs. Seeing several widths at once makes them obvious.
When you build on a laptop, it is easy to miss what happens on a narrow screen: a navigation bar that wraps onto three lines, cards that stay side by side until they are too thin to read, or a wide image that pushes the whole page sideways. Placing a phone, a tablet and a laptop next to each other shows where each part of the layout changes and where it breaks.
The default widths are 390 pixels, the width of many current phones, 768 for a tablet held upright, and 1280 for a small laptop. These are CSS pixels, the unit your stylesheet uses. A phone that is 390 CSS pixels wide may have three times as many physical pixels, which makes text sharper but does not change the layout. Enter a custom width to test the narrowest phone you support, such as 360 or 320.
One problem a frame cannot reproduce is a missing viewport tag, because each frame always lays the page out at its own width. On a real phone, a page without that tag is laid out about 980 pixels wide and then shrunk to fit the screen. The tool checks your source for the tag and warns you when it is missing or incomplete.
Breakpoints side by side
Phone, tablet and laptop frames update together from the same source.
Viewport check
A warning appears when the page lacks the meta tag phones need.
Private by design
The preview runs in your browser in sandboxed frames; nothing is uploaded.
The one line that makes a page mobile-friendly
Without it, phones pretend to be a desktop screen and shrink your page to fit.
Put this tag inside the head of every page. width=device-width tells the phone to use its real screen width for layout, and initial-scale=1 starts the page at normal zoom. Your media queries only work as intended on phones once this tag is present.
Avoid adding user-scalable=no or maximum-scale=1. They stop visitors from zooming in, which makes text hard to read for many people, and the preview notes it when it finds them.
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My page</title>
</head>What to check at each width
Look at the phone frame first; most problems appear there.
Nothing scrolls sideways
If a frame scrolls horizontally, something is wider than the screen. Common causes are fixed widths, wide tables, long words and images without max-width: 100%.
Text is readable
Body text around 16 pixels needs no zooming. Very long lines on the laptop frame are hard to read too; limit them with a max-width on the content.
Controls are easy to tap
Buttons and links in the phone frame should be at least about 44 pixels tall and not pressed against each other.
Navigation still works
Check that every important link is reachable at phone width, either visible or behind a clearly labeled menu button.
When the layout is right, test the final page on at least one real phone; the next section explains why.
What a browser preview cannot tell you
A preview answers layout questions. These need a real device or a full browser test.
Touch and hover
Hover menus have no hover on a touchscreen, and fingers are less precise than a mouse pointer.
Toolbars and safe areas
Mobile address bars change the visible height, and notches cut into the corners. 100vh behaves differently from the frame here.
Real performance
Phones have slower processors and networks. Large images and scripts that feel instant on a laptop can be slow on a phone.
Mobile preview questions
Fix the layout while you look at it
The HCODX editor has a responsive design tester beside your files, so you can edit CSS and watch every width update.
Instant HTML Runner & Viewer with Live Preview
Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.
Open HTML Runner Online