Tiny Online Tools logoTiny Online ToolssearchSearch tools…grid_viewAll Tools
Homechevron_right3D Toolschevron_right3D Embed Code Generator3D Embed Code Generator

3D Embed Code Generator

Generate ready-to-paste embed code for a 3D model in four flavours, free and entirely in your browser.

ModelThe public URL of your GLB or GLTF file. It must be served over HTTPS with CORS enabled, or the browser will refuse to load it.Read by screen readers, and used as the page title in the standalone HTML output.Shown while the model downloads. A good poster is the single biggest perceived-performance win available.LayoutUsed by the Three.js snippet: the element it mounts the canvas into.Transparent backgroundA transparent background lets the page show through, at the cost of one more blended layer to composite.BehaviourCamera controlsAuto-rotateAR buttonShadowsRenderingMultiplies scene brightness before tone mapping. 1.0 is neutral; raise it for dark models, lower it if highlights are blowing out.Presets are a React Three Fiber (drei) feature. model-viewer has one built-in environment called neutral, and the plain Three.js snippet uses RoomEnvironment — both are neutral studios, so the preset only changes the R3F output.In the model's own units. Measure a local file below to have this filled in for you.Measure a local file (optional)upload_file

Click to browse or drag & drop files here

Select a 3D model — GLB, GLTF, OBJ, STL, PLY, FBX, DAE or 3MF

Accepted: .glb,.gltf,.obj,.stl,.ply,.fbx,.dae,.3mf

Only used to read the model's size and suggest a camera distance. The file stays on your machine and never appears in the generated code.

Similar Tools

3D Web Optimizer

3D Web Optimizer

Optimize a 3D model for the web against a real performance budget, free and entirely in your browser.

3D Web Performance Analyzer

3D Web Performance Analyzer

Analyse how a 3D model will behave on the web, free and entirely in your browser.

3D Turntable Generator

3D Turntable Generator

Create a rotating turntable animation from a 3D model and export it as an animated GIF, WebM or MP4 — entirely in your browser.

3D Thumbnail Generator

3D Thumbnail Generator

Batch-generate consistent thumbnails for many 3D models at once, right in your browser.

PDF Grayscale Converter

PDF Grayscale Converter

Convert a color PDF to grayscale by rendering each page and rebuilding the document.

PDF to Text

PDF to Text

Extract plain text from PDF files instantly in your browser. No uploads, no sign-up required.

Image Converter

Image Converter

Convert images between JPG, PNG, WebP, and more formats.

apps

More Tools

Browse our full collection of free online tools.

Four ways to put a model on a page, all of them complete

Embedding a 3D model is one of those tasks where the sample code is always almost right. The snippet in the docs leaves out the resize handler. The blog post forgets controls.update(), so damping silently does nothing. The React example skips the Suspense boundary and throws on first render. This generator emits the whole thing, with the settings you actually chose baked in.

<model-viewer>

Google's web component is the shortest path from nothing to a working viewer: one <script type="module"> tag and one custom element. It handles camera controls, auto-rotate, AR on both Android and iOS, image-based lighting and a poster image on its own. If you want a model on a marketing page this afternoon, use this one.

The generated tag includes touch-action="pan-y", which is easy to miss and is the difference between a viewer that feels native on a phone and one that fights the page scroll.

Three.js

For a scene you control. The snippet imports from three/addons/* — a real subpath export in three's package, so it works under any bundler — sets up the renderer with ACES tone mapping and your exposure, builds a neutral studio environment through PMREMGenerator and RoomEnvironment, adds OrbitControls with damping, loads the model through GLTFLoader, handles resize, and runs on renderer.setAnimationLoop() rather than a bare requestAnimationFrame so the same loop keeps working if the page later enters WebXR.

React Three Fiber

The React version: @react-three/fiber for the canvas, @react-three/drei for useGLTF, OrbitControls, Environment and ContactShadows. useGLTF.preload() is called outside the component so the fetch starts before React renders, and the model sits inside a Suspense boundary with a real progress fallback driven by useProgress.

Standalone HTML page

A complete index.html — doctype, viewport meta, styles, CDN script, viewer. Save it, upload it to any static host, done. This is not the same as the first snippet: that one is a fragment for an existing page, this one is a whole file.

Camera distance

Guessing the camera distance is the most annoying part of embedding a model, because it depends on the model's real-world scale. Load your file locally and the tool measures its bounding sphere and computes the distance at which it fills a 45° frustum with a small margin. The file is never uploaded and never appears in the generated code — only the number does.