Lottie JSON Tweaker
Preview Lottie animations, check their basic structure and adjust fill and stroke colors in your browser.
Lottie JSON
62 lines · 1,080 charsLayers (1)
Preview & colors
Colors (1)
layers[0].shapes[0].it[1].c.kalpha 1 keptUses a lazy-loaded lottie-web preview and a deterministic client-side parser. Only assets.colors and layer k RGB arrays are editable.
Examples
Scoped color discovery
parseLottieJson(source).colors[{ assets[0].colors[0] }, { layers[0].c.k }, { layers[0].nested.k }]Only asset colors and layer k RGB arrays surface; metadata k is excluded.
Hex swap plus round-trip
replaceLottieColor(parsed, "layers[0].c.k", hexToLottieColor("#ff0080")){ layers[0].c.k: [1, 0, 0.5…], serialized via serializeLottie }The hex converts to 0-1 channels, replaces one path, and serializes back.
About this tool
Lottie JSON Tweaker edits animations with parseLottieJson(input), replaceLottieColor(document, path, color), and serializeLottie(document): the JSON deep-clones through structuredClone, color entries collect as { path, value } triples, and layers list as { path, ty, nm } entries.
Color discovery is scoped: arrays under assets colors collect every RGB triple while layers collect only k arrays holding three 0-1 channels — so layers[0].c.k qualifies but metadata k and freeform notes arrays stay untouched.
Layers resolve ty and nm with fallbacks: missing names become Layer N and non-numeric ty becomes null, while helpers lottieColorToHex and hexToLottieColor convert six-digit hex both ways and canRenderLottie gates the browser-only preview off in SSR and jsdom.
How to use this tool
Paste Lottie JSON
Provide the animation object with assets, layers, and color arrays.
Pick a color path
Choose a discovered entry like layers[0].c.k from the color list.
Replace the color
Apply an RGB triple or six-digit hex to that path only.
Export JSON
Copy the deterministically serialized animation for playback.
Use cases
Recoloring animations
Swap brand colors across asset palettes and layer fills by path.
Auditing layer structure
List ty and nm entries to map shape versus precomp layers.
Validating uploads
Catch malformed JSON and out-of-range channels with explicit errors.
Common mistakes
Mistake:Editing metadata k and expecting a color entry.
Fix:Only assets colors and layer k arrays are color paths — other triples throw a color-path error.
Mistake:Passing channels outside 0-1.
Fix:Lottie channels are normalized floats, so divide 0-255 values by 255 first.
Mistake:Pasting shorthand or eight-digit hex.
Fix:hexToLottieColor requires six digits — expand #f08 to #ff0088 before converting.
Frequently asked questions
What does this tool do?
It parses Lottie JSON into a cloned document with discovered color paths and a ty/nm layer list, replaces one color path at a time, and serializes the animation back deterministically.
Which arrays count as colors?
Arrays under assets colors plus layer k triples with 0-1 channels qualify — metadata k and freeform triples are excluded and throw a color-path error if edited.
Is my animation uploaded or stored?
No. Parsing, color replacement, hex conversion, and serialization run entirely in your browser.
Why an invalid JSON or hex error?
Malformed or non-object JSON throws Invalid Lottie JSON, channels outside 0-1 are rejected, and hex input must be six digits like #ff0080.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.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.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.