Embed

Put the units to mg converter on your own site

By the Decadewise team Education only Last updated 27 July 2026 Free to embed

The short version

What this is: our units to mg converter, packaged as a widget any site can host. One line of markup, one iframe, and the same arithmetic that runs on our own page.

What it costs: nothing. There is no account, no key, no quota, and no email required. Copy the line below and it works.

What we ask in return: leave the attribution link in place. That is the whole licence, and the full text is further down this page.

What it never does: recommend a dose, personalize anything, or read anything about the person using it. It converts the figures typed into it and stops there.

What it collects: nothing. No cookies, no local storage, no analytics script, no network call once the frame has loaded.

On this page

The live preview

This is the widget itself, loaded here exactly the way it loads on any other site. Type into it and watch the rows fill in.

The frame above is the file at /embed/calculator.html. It carries its own styles and its own script inline, so it makes no request to any other server, ours included, once it has loaded.

The one line

The recommended version: this loads the frame and sizes it to its own content, so it never leaves a strip of empty space or a scrollbar inside the box. The second half is what a visitor sees if their browser will not run scripts.

Copy this line

<script async src="https://decadewise.com/embed/embed.js"></script><noscript><a href="https://decadewise.com/tools/units-to-mg-converter/">Units to mg converter by Decadewise</a></noscript>

The widget appears where the line sits in your page. The loader is 3KB, has no dependencies, and sets nothing on your domain.

If you would rather choose the position yourself: put an empty element with a data-decadewise-embed attribute anywhere in the page, and the loader fills that element instead of writing at its own position.

Placeholder version

<div data-decadewise-embed></div>
<script async src="https://decadewise.com/embed/embed.js"></script>

Every element carrying the attribute gets its own frame, so several copies on one page are fine.

If you do not want our script at all: the plain iframe below skips the loader entirely. It cannot resize itself, so it keeps a fixed height, and the attribution line lives inside the frame rather than on your page.

Plain iframe, no script

<iframe src="https://decadewise.com/embed/calculator.html" title="Units to mg converter by Decadewise" width="100%" height="620" style="border:0" loading="lazy" sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"></iframe>

The sandbox attribute is ours to earn, not yours to trust: it denies our frame same-origin access to your page, and the widget is built to work without it.

The Decadewise briefing

One tool, one chart, or one piece of dose math like this, every week. Free.

Education only. Unsubscribe anytime.

What the widget computes

One equation, entered from either end: concentration is the vial's milligrams divided by the water's milliliters. Divide that by the syringe scale, 100 units per mL on a U-100 barrel or 40 on a U-40, and the result is the milligrams inside a single unit mark.

Milligrams to units: the amount is divided by the concentration to get a volume, and the volume is multiplied by the syringe scale to get the reading. Units to milligrams: the reading is divided by the syringe scale to get a volume, and the volume is multiplied by the concentration to get the mass.

Nothing is prefilled and nothing is assumed: the widget renders the concentration once a vial and a water volume exist, the per-unit figure once a syringe scale is chosen, and the conversion once an amount is typed. It has no view on what any of those numbers should be.

Worked example: 20mg vial + 2mL water = 10mg per mL, U-100 syringe, 1 unit = 0.1mg (100mcg)
MilligramsVolume on the barrelReads as, U-100
0.5mg0.05mL5 units
1mg0.1mL10 units
2mg0.2mL20 units
2.5mg0.25mL25 units
5mg0.5mL50 units
Those five rows are the widget's own output for that vial, that water volume and that barrel. Change any of the three and every figure changes with it.

The arithmetic is byte-identical to the page it came from: the widget and the full converter run the same four lines of math, so a figure produced on your site and the same figure produced on ours cannot disagree.

What it collects from your visitors

Nothing, and that is a design constraint rather than a promise: the widget sets no cookie, writes no local storage, loads no font, no image and no analytics script, and makes no network request of any kind after the frame itself has loaded. Every figure typed into it is converted inside that frame and never leaves the browser.

How we count embeds: a browser loading the frame sends our server the same referrer header it sends for any cross-site request, which tells us the site the frame was loaded on and nothing else. That is the whole measurement, it comes out of an ordinary server log, and it says nothing about any individual visitor.

What the loader does on your page: it creates one iframe and one credit line, listens for one message carrying one number, the height, and ignores every other message it receives. It reads nothing from your page and writes nothing to your domain.

The licence, in plain words

Free to use, on any site: commercial or not, one page or a thousand. No permission needed and no attribution email required. Take the line, ship it, and remove it whenever you like by deleting the line.

Keep the attribution link visible and working: the loader writes a single credit line under the frame, and the frame itself carries a "Powered by Decadewise" link. Whichever version you use, one of those links has to stay where a reader can see and follow it. That link is the only payment.

The link can be marked however your policy needs: a rel="nofollow" or rel="sponsored" attribute on it is fine by us, and we will never ask anyone to use particular anchor text or to bury a keyword in it. We want the credit and the reader, not a ranking signal we asked someone else to hand over.

Do not change the math: the equation, the U-100 and U-40 constants, and the empty-until-filled behaviour are the reason this is safe to hand out. A modified copy that alters any of them is not our tool and must not carry our name.

Do not present it as a dosing service: the widget converts figures it is given. Wrapping it in copy that reads as a recommendation, or pairing it with a prefilled dose chart, breaks the licence, because it turns a converter into advice we did not write and would not write.

Hosting your own copy is allowed: the file is a single self-contained page, so a copy on your own server works. Keep it unmodified, keep the attribution and the disclaimer intact, and understand that a copy stops receiving our corrections the day you take it.

How wide is it, and can it match my styling?

It fills whatever box you give it: the frame is set to 100 percent width, so it takes the width of its container. The layout reflows down to a 320px viewport, and the two-column field grid collapses to one column below 420px.

Two hooks for your own CSS: the wrapper is .decadewise-embed and the credit line is .decadewise-embed__credit. Both are on your page, so your stylesheet reaches them normally.

Inside the frame is deliberately plain: a system font stack, a light background and one accent colour, so it reads as a tool on your page rather than a transplanted piece of ours. It cannot inherit your fonts, because an iframe is a separate document and pulling one across the network would break the no-external-requests rule this widget is built on.

What happens when we correct something?

Your embed updates itself: the frame is served from our domain, so a fix to the widget reaches every site carrying it the next time a visitor loads the page. Nobody has to re-copy the snippet.

The math is not going to move: a unit is a fixed fraction of a milliliter and the bridge equation is division. What can change is wording, layout, or a rendering bug, and those changes are held to the same standard as any page here, which is written down on the methodology page.

If the widget is ever retired: the URL redirects to the converter page rather than going dark, so an embed that outlives the widget degrades into a link instead of a blank box.

What does a visitor see without JavaScript?

A plain link, never a broken box: the widget starts in a no-script state that hides the input fields and shows a sentence pointing at the full converter. If scripts are blocked, that sentence and its link are what renders.

The snippet carries its own fallback too: the noscript half of the recommended line renders a text link when the loader itself cannot run, so a visitor with scripts off still gets somewhere useful rather than an empty gap in your article.

Screen readers and keyboards are first-class: every field has a label, the syringe and direction controls are real buttons carrying their pressed state, and the results region announces itself politely when the numbers change.

The disclaimer

Every page is reviewed by medical professionals before it ships, and written with longtime biohackers who were doing this before it was a trend. Reviewed still does not mean prescribed: nothing here is medical advice.

It is research, trial data, and reported use, with the numbers intact so you can check them. For decisions about your body, see a doctor who can look at your labs.

The weekly briefing

Get the next tool before it is embeddable.

New converters, new charts, and the arithmetic behind the next confusing vial label. One clear email a week.

Education only, never medical advice. Unsubscribe anytime.