DevTools Logo

Web Vitals Budget Simulator

Web Vitals Budget Simulator

Estimate LCP, INP, CLS and Total Blocking Time from a deterministic browser-side resource budget.

Resources

Transfer sizes use a 10 Mbps reference connection. Add dimensions and shifts to model layout movement.

Resource 1
Resource 2
Resource 3

Examples

Single script baseline

Input
calculateWebVitals([{ type: "script", sizeKb: 100, transferSizeKb: 100, delayMs: 20, executionMs: 40 }])
Output
transferMs: 80, lcp: 100 (good), inp: 40 (good), tbt: 0

80 ms of transfer plus 20 ms delay blocks render for 100 ms; 40 ms of execution stays under every INP and TBT threshold.

Over-budget combination

Input
calculateWebVitals([{ type: "script", sizeKb: 1, transferSizeKb: 3125, executionMs: 600 }, { type: "other", sizeKb: 1, width: 360, height: 800, horizontalShift: 90 }])
Output
lcp: good, inp: poor, cls: needs-improvement, tbt: 550

2500 ms of blocking transfer sits exactly on the LCP budget while 600 ms of execution blows INP and the 0.25 shift fraction lands mid-CLS-range.

About this tool

Web Vitals Budget Simulator estimates Core Web Vitals from a resource list with calculateWebVitals(resources): each resource contributes transfer time at 0.8 ms/KB (a 10 Mbps reference), render-blocking transfer plus delayMs accumulates into LCP, executionMs plus inputDelayMs accumulates into INP, and sized elements with shift offsets accumulate into CLS as impact fraction times shift fraction over a 360×800 viewport.

Ratings follow Google's thresholds — LCP good at or below 2500 ms (needs improvement to 4000), INP good at or below 200 ms (needs improvement to 500), CLS good at or below 0.1 (needs improvement to 0.25) — each returned with its value, rating, and budget. Total Blocking Time sums max(0, executionMs − 50) per resource, mirroring the long-task heuristic.

Defaults keep estimates deterministic: scripts, styles, and fonts count as render-blocking unless overridden, script execution defaults to sizeKb × 0.05 ms, shifts at or below 1 are read as ratios while larger shifts divide by viewport dimensions, and an empty list yields zeros across every metric — reordering resources never changes the totals.

How to use this tool

  1. List the resources

    Enter each script, style, image, font, document, or other asset with its transfer size, execution cost, delays, and (for shifting elements) dimensions plus shift offsets.

  2. Read the three vitals

    Compare LCP against 2500 ms, INP against 200 ms, and CLS against 0.1 — the rating field flags good, needs-improvement, or poor directly.

  3. Find the bottleneck

    Split transferMs, executionMs, inputDelayMs, and renderBlockingMs to see whether bytes, main-thread work, input latency, or blocking order dominates.

  4. Iterate on the budget

    Shrink transfer sizes, defer render-blocking scripts, or cut execution over 50 ms per task, then re-run — identical inputs always give identical outputs.

Use cases

Sizing a performance budget

Translate kilobyte and millisecond allowances into predicted LCP/INP/CLS ratings before writing code.

Triaging layout shift

Model each shifting element's impact-by-distance product to find which one pushes CLS past 0.1.

Justifying script deferral

Show how render-blocking transfer and delay feed LCP so non-critical scripts earn their defer or async attributes.

Common mistakes

Mistake:Confusing delayMs with inputDelayMs.

Fix:delayMs feeds render-blocking time (LCP); only inputDelayMs and executionMs feed INP — a slow start delay will not move the INP needle.

Mistake:Passing pixel shifts above 1 and expecting ratio semantics.

Fix:Values above 1 divide by viewport width/height (e.g. 90 px horizontal = 0.25); pass 0–1 fractions directly only when you mean ratios.

Frequently asked questions

What does this tool do?

It estimates LCP, INP, and CLS from your resource list — transfer at 0.8 ms/KB, render-blocking time into LCP, execution plus input delay into INP, shift impact into CLS — with Google-threshold ratings (LCP 2500 ms, INP 200 ms, CLS 0.1) and a TBT total, all deterministically.

Why didn't my start delay improve INP?

delayMs feeds render-blocking time (LCP), not INP — only executionMs and inputDelayMs move INP. A 200 ms start delay raises renderBlockingMs while INP stays flat; add inputDelayMs to model input latency.

Is my budget model uploaded or stored?

No. The transfer, blocking, execution, and shift math runs fully client-side — your resource list never leaves your device.

How should I read pixel shifts versus ratio shifts?

Shift values above 1 are treated as pixels and divided by the 360×800 viewport (90 px horizontal = 0.25), while 0–1 values are read as ratios directly. A full-viewport element shifted 36 px scores CLS 0.1 — exactly on the good budget.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML