Draw Analog Clock
Draw a real-time or custom analog clock in your browser. Sweeping second hand, Roman/Arabic numerals, 3 themes, PNG export. Free, offline, client-side, instant.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Render an HTML5 Canvas analog clock - live or any custom time, smooth sweeping second hand, Roman or Arabic numerals, 3 themes.
How to Use Draw Analog Clock
- On load, the clock displays your device's local time with the smooth sweep enabled. The status line shows mode (Live / Custom), the time string, sweep/tick, theme, and device-pixel-ratio.
- Pick numerals: Arabic (1-12) or Roman (I-XII). For Roman, "IIII" is sometimes used historically instead of "IV" (clockmaker convention); we use standard "IV".
- Pick a theme: Classic (cream face, dark hands, red second), Minimal (white + black), or Night (dark blue face, indigo accents, rose second).
- Set a custom time via the HH:MM time input plus optional seconds (0-59). Click "Apply custom time" or press Ctrl+Enter.
- Toggle sweep for the live-time mode. Sweep computes sub-second motion from
Date.getMilliseconds()so the second hand glides between marks. Disabled = integer-second ticks (the classic "step" you hear on cheap quartz). - Snapshot PNG exports the current canvas at the device-pixel-ratio resolution (so 800 × 800 on a Retina display). "Copy" puts the PNG bytes on your clipboard via the Async Clipboard API (with data-URL textfallback for older browsers).
- Resize the window: the canvas re-initialises its DPR-scaled backing store and redraws crisply.
Frequently Asked Questions
Why is my Retina display getting a crisp clock now?
The canvas has TWO resolutions: a CSS resolution (what you see, 400 × 400 here) and a backing-store resolution (the actual pixel buffer). On a Retina display, window.devicePixelRatio is 2 (or 3 on some phones). We set the backing store to 800 × 800 (= 400 × DPR), then scale the drawing transform by DPR. Result: 4× the pixel count for sharp anti-aliased lines. Without this, a 400×400 backing store gets upsampled to 800 physical pixels by the browser, causing blurry rendering.
What’s the difference between sweep and tick?
Tick (disabled sweep): second hand moves in integer-second jumps – the classic step-step-step motion of a cheap quartz watch. The hand sits exactly between two tick marks during each second. Sweep (enabled): second hand moves continuously, computed from getMilliseconds() as a sub-second fraction. Looks like a high-end mechanical watch or a Rolex. Sweep runs at requestAnimationFrame rate – typically 60 FPS, but adaptive (drops to 30 if your tab is busy, freezes if your tab is backgrounded). Tick uses the same rAF loop but quantises to integer seconds.
Does custom-time mode animate?
No, custom mode is a single static frame. We cancel the rAF loop when you apply custom time. Changing the theme or numeral style triggers a redraw of the same custom moment. Sweep mode is also disabled in custom (since there’s no continuously updating millisecond stream – you set a specific moment). To see custom time “running,” apply your custom time then mentally count from there – or use a separate countdown tool.
Why does my clock show 23:45 with the hour hand near 12?
Because 23 mod 12 = 11. The hour hand only knows positions 0-11 (12 is just position 0). 23:45 is “45 minutes past 11,” which is 75% of the way from 11 to 12 = very close to the 12 position. Not a bug – it’s how analog clocks work.
What’s the snapshot file like?
800 × 800 PNG (assuming DPR = 2 – would be 400 × 400 on a non-Retina display, 1200 × 1200 on a 3× Retina). The file captures the current frame including theme, numeral style, and exact second-hand position. PNG is lossless – fine for the small palette (~6 distinct colors). Filename pattern: analog-clock-<timestamp>.png.
Why “IV” not “IIII” for 4?
Traditional analog clocks often use “IIII” for 4 instead of the subtractive “IV.” There’s no single agreed reason – proposed explanations include symmetry with “VIII” opposite, easier mold-casting, avoiding the IV symbol of Jupiter on Roman religious objects, or just clockmaker tradition. Both are mathematically correct Roman numerals; modern usage favors “IV” everywhere else. We use “IV” for consistency with standard Roman conventions.
Does this drain my battery?
Minimal. requestAnimationFrame auto-pauses when the tab is backgrounded – so on your phone, switching to another app freezes the clock until you return. Sweep at 60 FPS is one drawing pass per frame (clear + face + 60 ticks + 12 numerals + 3 hands + center = ~80 canvas operations). On modern devices that’s microseconds of CPU.
Can I embed this?
The tool is a standalone HTML page – embed via <iframe>. For a standalone canvas widget, you’d need to extract the JS and call DrawAnalogClockLogic.calculateAngles() + the drawing functions yourself. The logic module is pure (no document.*) so it’s reusable as-is in Node or other frameworks.
Is my data secure?
Yes. 100% client-side. No fetch/XHR. No telemetry. The clock reads your local time from JavaScript’s Date object – which uses your operating system’s clock and timezone. Nothing leaves your device.
Related Tools
Draw Digital Clock →
Live HH:MM:SS digital clock with 24-hour toggle, milliseconds, 3 themes, screenshot export. Free, offline,…
Add Fuzziness to Clock Time Generator →
Add Fuzziness to Clock Time Online - Generate randomized time variations for testing, simulations,…
Analyze Clock Time →
Mathematically Analyze Clock Time perfectly. Uncover fuzzy phrasing, precise AM/PM calculations, completed percentages, and…
Calculate Average Clock Time →
Calculate the average clock time from a list using circular mean - correct across…
Calculate Clock Hand Angle →
Calculate the angle between clock hands instantly in your browser. Free, offline, client-side -…
Decrement Clock Time →
Subtract hours, minutes, seconds, milliseconds from any time with day-wrap counter, 12/24-hour display, fractional…
Draw Memento Mori Calendar →
Draw Memento Mori Calendar online, free and private. Runs in your browser, no upload,…
Draw Monthly Calendar →
Generate any month from year 1500-3000. Sunday/Monday week start, Today highlight, SVG/PNG export. Free,…
Clock Time Formatter →
Convert a clock time between 24-hour and 12-hour formats, with or without seconds.
Random Clock Time Generator →
Generate random clock times in the 24-hour or 12-hour format you choose, with optional…
Palindrome Clock Time Finder →
List the palindrome times on a 24-hour clock, which read the same forward and…
Add Time to Clock Online →
Add or subtract hours, minutes, or seconds from a clock time, wrapping past midnight.