Logical Sizing Properties Demo - Online blockâsize & inlineâsize
Compare width/height with blockâsize/inlineâsize in different writing modes. Understand intrinsic sizing. Copy best practices.
UD5 Toolkit
window.innerWidth / window.innerHeight) represent the viewport â the actual content area of the browser where your web page renders. Outer dimensions (window.outerWidth / window.outerHeight) include the entire browser window, encompassing toolbars, tab bars, address bar, bookmarks bar, and window borders. On mobile browsers, inner and outer values are often identical since mobile browsers typically run in full-screen mode without additional window chrome.
screen.width / screen.height return the full resolution of the user's monitor in physical pixels. screen.availWidth / screen.availHeight return the screen space actually available to browser windows â this excludes permanent OS UI elements like the taskbar (Windows), Dock (macOS), or system menu bars. On a 1920Ă1080 monitor with a 40px taskbar, availHeight would be 1040px. On mobile devices, these values are usually identical since apps occupy the full screen.
window.devicePixelRatio) is the ratio between physical pixels on the screen and CSS logical pixels. A DPR of 1 means 1 CSS pixel = 1 physical pixel. A DPR of 2 (common on Retina displays and most modern smartphones) means 1 CSS pixel = 2Ă2 = 4 physical pixels, enabling sharper text and images. Common values: 1 (standard desktop), 1.25â1.5 (some Windows laptops), 2 (MacBook Retina, iPhone, many Androids), 3 (iPhone 14/15 Pro Max, Samsung Galaxy flagships). Web developers use DPR to serve appropriately sized images via srcset and to adjust canvas rendering for crisp output.
window.innerWidth and document.documentElement.clientWidth is the scrollbar width. innerWidth includes the vertical scrollbar (typically 12â17px on desktop), while clientWidth excludes it. This is important when calculating available layout space. On macOS with overlay scrollbars or mobile devices, the difference is usually 0. This tool displays the scrollbar width in real-time under "Extra Info."
window.visualViewport) provides dimensions of the currently visible area, accounting for on-screen keyboards, pinch-zoom, and other mobile-specific factors. When a virtual keyboard appears on mobile, the visual viewport shrinks while the layout viewport (innerHeight) may remain unchanged. This API also reports offsetTop (how far the visual viewport is offset from the layout viewport) and scale (current pinch-zoom level). It's essential for positioning fixed elements like chat input bars or sticky footers correctly on mobile.
window.innerWidth, and 1vh = 1% of window.innerHeight. However, on mobile Safari, 100vh can be larger than the visible area because it doesn't account for the address bar. New CSS units like svh (small viewport height), lvh (large viewport height), and dvh (dynamic viewport height) address this. The Visual Viewport API provides the most accurate mobile viewport measurement. Use dvh for elements that need to fill the screen exactly on mobile.
resize event fires rapidly during window dragging â potentially 60+ times per second. Best practices: 1) Use requestAnimationFrame to throttle updates to the screen refresh rate. 2) Debounce with a 150â300ms delay if you only need the final value. 3) Use ResizeObserver for observing specific elements rather than the whole window. 4) Match media queries with window.matchMedia() for breakpoint-specific logic. This tool uses requestAnimationFrame for smooth, performant real-time updates.
outerWidth/outerHeight often equal innerWidth/innerHeight because mobile browsers lack separate window chrome. Additionally, when a browser window is maximized vs. fullscreen (F11), outer dimensions change significantly. For reliable layout calculations, always use inner dimensions or the Visual Viewport API.
Compare width/height with blockâsize/inlineâsize in different writing modes. Understand intrinsic sizing. Copy best practices.
Enter a URL and extract tabâindex order violations and focusable elements. Quick accessibility audit. Clientâside fetch.
Paste text and instantly see if it contains hidden zeroâwidth characters often used in steganography. Reveal invisible payloads.
Plot different BigâO complexities on a chart. See how O(log n) stays flat while O(2^n) explodes. Educational reference.
Paste text and detect its language (70+ languages) using a simple character n-gram model implemented in JavaScript. No server communication.
Open a test video in PictureâinâPicture mode. Control entering and leaving PiP. Copy the code snippet for your own app.
Simulate forcedâcolors mode and see how your site looks. Adjust CSS system colors. Make your design accessible.
Paste HTML and see the order in which elements would receive focus via Tab key. Highlight issues. Local accessibility testing.
Enter a URL and see a visual map of the tab order. Detect broken tabindex values. Improve keyboard navigation.
See your current page load broken down into DNS, TLS, request, and DOM phases. Understand where time is spent.
See your current page load broken down into DNS, TLS, request, and DOM phases. Understand where time is spent.
Create simple 2â or 3âset Venn diagrams by entering commaâseparated lists. Shareable via URL fragment. No account.
Paste HTML and see a collapsible tree of tags. Understand document outline and nesting. Handier than raw code.
Paste a website's HTML and see which text is only visible to screen readers (e.g., .srâonly). Preview the accessible layer.
Stack multiple background images and blend them with colors. Create unique textures. Copy the CSS code instantly.
Build a simple decision tree by adding yes/no nodes. Flowchart style. Export as text outline.
Highlight elements with ariaâdescribedby and see the linked description text. Verify a11y annotations.
Watch classic sorting algorithms step through a randomized bar chart. Adjust speed and array size. Great for learning algorithm efficiency.
Create categorized shopping lists (produce, dairy, meat, etc.). Add items, check them off, and print. Data stored in your browser. Never lose a list.
Drop a file to see its MIME type and the first few magic bytes (hex and ASCII). No upload, works instantly.
Drop a file and see its detected type based on the first bytes (magic number). Identifies hundreds of formats. Local.
Test overscrollâbehavior: contain to prevent background scroll or pullâtoârefresh. See the effect in a live demo.
Toggle scrollbarâgutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Check how many pages a PDF has without uploading it (uses FileReader). Also shows file size and title if available. Simple and fast client-side tool.
Choose the right extinguisher for kitchen, electrical, or garage fires. Interactive class chart. Home safety education.
Enter a URL and see its CORS headers. Understand why a fetch fails. Check preflight responses. Clientâside debugger.
Visualize how caffeine decays in your body over time. Enter intake amount and see remaining caffeine at bedtime to optimize sleep. Uses standard 5-hour half-life.
Enter an acronym and see its most common full forms. Static dictionary. No internet needed after load.
Encode or decode text using Base32 scheme. Ideal for legacy systems and data obfuscation. Works completely offline in your browser for maximum security.
Simulate reduced motion preference and test your animations. Copy the media query snippet. Keep your users safe.