# Embed a 3D model viewer on your website

> Put an interactive STL, 3MF, OBJ, GLB or STEP viewer on your page with one iframe. Free, no account, no upload: files go from your server to the visitor.

Source: https://freestlviewer.com/embed-3d-viewer/  
Updated: November 14, 2026

Paste one iframe and your visitors can rotate and zoom your STL, 3MF, GLB or STEP files right on your page. Enter the address of your model below, check the preview, copy the code. Free, with no account and no upload. The tool is interactive: open https://freestlviewer.com/embed-3d-viewer/ and drop a file onto the page.

## How it works

The code is an iframe that loads the Mes3D viewer from freestlviewer.com and
tells it where your model is. Your visitor's browser downloads the model from
your server and draws it on their own device: nothing is uploaded to Mes3D, and
the file never passes through our servers. Visitors can drag to rotate, scroll
or pinch to zoom, and open the viewer full screen.

Leave the model address empty and you get a drop-a-file viewer instead:
visitors drop their own STL or 3MF onto your page and see it right away. That
is handy for a print shop's quote page or a maker club's website.

## Use cases

- **Selling STL files or printed parts.** Let buyers turn the model before they
  pay instead of guessing from two screenshots.
- **Documentation and kits.** Show the exact part a step refers to, in 3D.
- **Portfolios and project write-ups.** A model is easier to read than a
  render, and visitors can see it from any side.
- **Teaching.** Put a model next to the lesson text without asking students to
  install anything.

## Options

The generator writes these for you, but you can also edit the address by hand:

| Parameter | Values | What it does |
| --- | --- | --- |
| `src` | Full `https://` address of the model | The file to show; leave it out for a drop-a-file viewer |
| `name` | File name, for example `part.stl` | Sets the format when the address has no file extension |
| `bg` | `light` | Light background instead of dark |
| `color` | Hex colour without `#`, for example `ff9500` | Model colour; files with their own colours keep them by default |
| `spin` | `0` | Do not turn the model while it waits for the first touch |

## Allowing the download (CORS)

Browsers only let one website download a file from another website when the
second one allows it. Your model files need this response header:

```
Access-Control-Allow-Origin: https://freestlviewer.com
```

- **nginx:** inside the `location` that serves your models, add
  `add_header Access-Control-Allow-Origin "https://freestlviewer.com";`
- **Apache:** in `.htaccess` next to the files, add
  `Header set Access-Control-Allow-Origin "https://freestlviewer.com"`
- **Amazon S3, Cloudflare R2, Google Cloud Storage:** add a CORS rule that
  allows `GET` from `https://freestlviewer.com`.
- **GitHub:** "raw" file links (`raw.githubusercontent.com`) already allow it.

If the header is missing, the viewer says so instead of showing an empty box.
Files can be up to 200 MB, but a few megabytes load much faster for visitors on
a phone.

## The credit link

The code ends with a short line under the viewer, "3D viewer: Mes3D", linking
to this site. It is plain and visible, it names the tool and nothing else, and
it is yours to keep, move or remove. If you keep it, thank you: it is how other
people find a free viewer they can use too.

## What it does not do

The embedded viewer is for showing a model, not editing it. Measuring, mesh
analysis, conversion and repair are on the full [Mes3D viewer](https://freestlviewer.com/) and the
[tools](https://freestlviewer.com/tools/) pages. Animations in FBX or glTF files are not played.

## Frequently asked questions

### How do I embed an STL file on my website?

Upload the STL to your own site, enter its address in the generator on this page, and paste the code it gives you into your page as HTML. Visitors see an interactive 3D viewer that they can rotate and zoom. The same works for 3MF, OBJ, GLB, STEP and the other formats Mes3D opens.

### Why does the viewer say the model could not be downloaded?

The browser blocks downloads from another domain unless that server allows it with a CORS header. Add Access-Control-Allow-Origin for https://freestlviewer.com (or *) to your model files, or host them somewhere that already sends it, such as GitHub raw links.

### Is the embedded 3D viewer free?

Yes, with no account, no watermark on the model and no limit on page views. A small Mes3D link sits in the corner of the viewer, and the code includes a short credit line under it that you can keep or remove.

### Are my model files uploaded to Mes3D?

No. Your visitor's browser downloads the file from your server and renders it locally. The file never passes through Mes3D's servers.

### Can I embed models from Thingiverse, Printables or MakerWorld?

Usually not by link, because those sites do not allow other domains to download their files. Use files you host yourself, and only models you have the right to share.

### Does it work in WordPress, Shopify or Squarespace?

Yes, anywhere you can add custom HTML: a Custom HTML block in WordPress, a Liquid or HTML section in Shopify, a Code block in Squarespace or an Embed element in Wix.
