Bookmarklet Code Builder - Online Convert JS to Bookmark
Write a JavaScript snippet and get a ready‑to‑drag bookmarklet link. With minification and encoding. Easy browser tools.
UD5 Toolkit
Interactive deep copy tester — write any JavaScript object, clone it, and verify true deep cloning in real time.
Supported in all modern browsers// Run structuredClone() to see the original object here
// Run structuredClone() to see the cloned object here
| Type | Support | Notes |
|---|---|---|
| Primitives (string, number, boolean, null, undefined, bigint) | Fully preserved | |
| Plain Objects & Arrays | Deeply cloned | |
| Date | Preserved as Date instance | |
| RegExp | Preserved as RegExp instance | |
| Map & Set | Deeply cloned with entries | |
| ArrayBuffer & TypedArrays | Binary data preserved | |
| Blob & File | Preserved | |
| ImageData | Pixel data cloned | |
| Circular References | Handled natively | |
| NaN, Infinity, -Infinity | Preserved (unlike JSON) |
| Type | Support | Notes |
|---|---|---|
| Functions | Throws DataCloneError | |
| Symbols | Throws DataCloneError | |
| DOM Nodes | Throws DataCloneError | |
| WeakMap & WeakSet | Throws DataCloneError | |
| Prototype Chain | Not preserved; plain Object only | |
| Error.stack | Error objects clone but lose stack | |
| Class Instances | Lose prototype, become plain objects |
| Feature | structuredClone() | JSON methods | Spread / Object.assign |
|---|---|---|---|
| Deep Copy | Shallow only | ||
| Circular References | Throws error | ||
| Date objects | Becomes string | Shared ref | |
| RegExp | Becomes {} | Shared ref | |
| Map / Set | Not supported | Shared ref | |
| undefined values | Preserved | Removed | Preserved |
| NaN / Infinity | Preserved | → null | Preserved |
| ArrayBuffer | Shared ref | ||
| Blob / File | Shared ref |
JSON.parse(JSON.stringify()) and safer than manual shallow copying with spread operators.
JSON.parse(JSON.stringify()), which throws a TypeError: Converting circular structure to JSON error. Try the "Circular Reference" preset above to see it in action.
Window or MutationObserver. If your object graph contains any of these, a DataCloneError will be thrown. Additionally, prototype chains are not preserved — cloned class instances become plain objects. Error objects clone but lose their stack property.
undefined and NaN values, handles circular references, and is generally faster for complex objects. JSON methods are still useful when you need cross-environment serialization (e.g., sending data over HTTP) or when you intentionally want to strip functions and prototypes. For pure in-memory deep cloning in the browser, structuredClone() is the recommended approach.
@ungap/structured-clone. Check caniuse.com/structured-clone for the latest compatibility data.
Object.prototype. If you clone an instance of a custom class, the clone will be a plain object without the class's methods. If you need prototype preservation, consider a custom deep clone implementation or a library like Lodash's _.cloneDeep().
structuredClone(value, { transfer: [...] }) allows you to transfer ownership of ArrayBuffer objects (and similar transferable types) to the clone. After transfer, the original buffer becomes detached (length 0) and unusable. This is useful for zero-copy data transfer between workers. For basic deep cloning, you typically don't need this option — just call structuredClone(yourObject).
Write a JavaScript snippet and get a ready‑to‑drag bookmarklet link. With minification and encoding. Easy browser tools.
Animate text that looks like it's being decoded or scrambled before settling on the final word. Copy the JS snippet.
Drop a PDF and extract any embedded JavaScript or form actions. Check for malicious code. Privacy‑friendly analysis.
Paste JavaScript and catch syntax errors instantly with line numbers. Lightweight pre‑commit check. Local.
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
Watch a simulation of how the JavaScript event loop handles synchronous code, microtasks, and macrotasks. Learn async.
Create promises that resolve or reject after a delay. See state changes and chain .then/.catch. Debug async code.
Write a generator function and step through it with next(). See values and done state. Understand iterators.
Set perspective and rotate children in 3D space. See the effect of perspective‑origin. Copy the CSS. Learn 3D transforms.
Drag to resize a box and see the Resize Observer callback fire. Get contentRect and borderBoxSize. Learn the API.
Write JavaScript using element.animate() and see the result in a live preview. Compare with CSS keyframes. Debugger included.
See every touch point with coordinates, radius, and force on your mobile device. Debug gestures with live overlay.
Write a compute shader in WGSL and run it in the browser. See the output on a canvas. Learn WebGPU. Real‑time compilation.
Type directly into a contenteditable div with real‑time CSS filters, shadows, and colors. Download as HTML. Fun demo.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
Choose Babel presets (env, React, TypeScript) and plugins. Get a clean babel.config.json to transpile your code. Local tool.
Press any key to see the complete KeyboardEvent properties: key, code, keyCode, modifiers. Indispensable for game & shortcut developers.
Pick two images or colors and apply all 16 CSS mix‑blend‑mode values live. See and copy the right CSS for your design.
Experiment with the CSS color-mix() function. Pick two colors and mix them in different color spaces (srgb, oklch). Copy the CSS.
Interactively add and adjust multiple box shadows on a sample element. Drag sliders for offset, blur, spread, and color. Copy the clean CSS code instantly.
Write JavaScript code and see the output or console.log results immediately. Safe iframe sandbox. For quick experiments.
Paste any JavaScript snippet and get a ready‑to‑drag bookmarklet link. Minify and encode automatically. Pure client.
Convert any text into JavaScript‑style \uXXXX escape sequences and vice versa. Handles emojis. Useful for i18n development.
Experiment with CSS Grid properties visually. Add rows, columns, and areas. See the grid in action and copy the code.
Paste any JavaScript expression and see its evaluated type and value. Understand JS coercion and type quirks. Educational.
Type any condition and see the result of the ternary operator. Understand truthy/falsy values. Quick learning tool.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Press any key to see the corresponding JavaScript event key, code, and keyCode. An essential debugging tool for front-end developers handling keyboard input.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.
Make your JavaScript code more readable with this online beautifier. Format and indent JS automatically. Works entirely in your browser, protecting your code privacy.