How to embed a 3D model
- Put the model file somewhere it has a public address: your own site, a GitHub Pages repository, a storage bucket.
- Paste that address into the box above and click Update preview.
- Choose the background, size and whether the model turns.
- Copy the code and paste it into your page, where the model should appear.
What happens when a visitor opens your page
The small frame loads the viewer from 3dfiles.app, and the viewer fetches the model straight from your address into the visitor's browser. The file never passes through our servers. Its address is carried in the part of the link after the #, which browsers do not send to any server, so we do not learn it either.
If the model does not appear: CORS
A browser only lets one site read a file from another site if the server that holds the file allows it. The server has to answer with the header Access-Control-Allow-Origin: *. Whether it does depends on where the file is:
| Where the file is | Works? |
|---|---|
| GitHub Pages, raw.githubusercontent.com | Yes |
| Cloudflare R2, Amazon S3, Google Cloud Storage | Yes, after you add a CORS rule to the bucket |
| Your own web server | Yes, after you add the header for the model folder |
| Dropbox, Google Drive, OneDrive share links | No: they serve a web page, not the file |
On an Apache server, a file named .htaccess in the model folder with the line Header set Access-Control-Allow-Origin "*" is enough. On nginx: add_header Access-Control-Allow-Origin *;.
Which format to use
GLB is the best choice for a web page: it is compact and keeps colours and textures. STL, OBJ, 3MF and PLY work as they are. STEP works too, but the visitor's browser has to load the CAD engine first, which takes a few seconds; for a product page, convert the STEP to GLB with the STEP to GLB converter and compress it.
A link instead of an embed
Copy a link to the viewer gives an address that opens the same model in the full viewer, with measuring, section view and the parts list. Use it to send a model to a colleague or customer without attaching the file.
Common questions
Is it free?
Yes. The embedded viewer is free and shows a small "3dfiles viewer" link in the corner.
Do you host my model?
No. The file stays where you put it; the viewer loads it from there. If you remove the file, the embed stops showing it.
How big can the file be?
Up to 300 MB, but visitors have to download it, so keep web models small: a few megabytes at most. The GLB compressor helps.
Does it work in WordPress, Shopify, Webflow or Notion?
Anywhere that accepts an HTML iframe: a Custom HTML block in WordPress, a custom liquid or HTML section in Shopify, an Embed element in Webflow. Notion and similar tools accept the link in an embed block.
Can visitors download my model?
The viewer has no download button, but anything a browser can display can also be saved by a determined visitor. Do not embed a file you must keep secret.