Embed a Live Moon Phase Widget on Your Site

Show the current moon phase on your own website, blog or online shop — free, with no sign-up and no maintenance. Copy one short code, paste it into your page, and the widget updates itself every time a visitor opens it.

  • Today’s moon phase with a live drawing of the Moon and its illumination percentage
  • The Moon’s zodiac sign and exact degree, plus the date and time of its next sign change
  • Next New Moon and next Full Moon, with a countdown in days and hours
  • Light, dark or automatic theme, in English or French, and a layout that adapts to phones

Live preview

Moon data by horoscope-us.com

This is exactly what your visitors will see: the phase, the Moon sign and the next lunations are calculated for the moment they open your page, and all dates and times are shown in their own local time.

Get the embed code

Click Copy, then paste the code where you want the widget to appear. It has three short lines: the widget itself, a tiny script that adjusts its height automatically, and a credit link.

Prefer a dark widget?

The default code follows your visitor’s light or dark mode. If your site always has a dark background, use this version instead:

French version (widget en français)

How to add the moon phase widget to your site

The code works on any website that accepts an embed or HTML block. Here is where to paste it on the most common platforms (some website builders reserve code blocks for their paid plans).

WordPress

  1. Open the page or post in the block editor.
  2. Click +, search for Custom HTML and add that block.
  3. Paste the code, then click Preview and Update.

To place it in a sidebar or footer, go to Appearance → Widgets (or the Site Editor) and add a Custom HTML block there. Use the Custom HTML block rather than a Paragraph block: a paragraph would show the code as text instead of running it.

Wix

In the editor, click Add Elements → Embed Code → Embed HTML, choose Code, paste the code and click Update. Wix shows embeds in a fixed-size box: drag its handles to about 600 px high on desktop, and check the mobile view, where the cards stack and need more height.

Squarespace

Edit the page, add a Code block, paste the code and make sure the mode is set to HTML. Save, then view the published page (code blocks are not always rendered inside the editor).

Blogger

For a sidebar, go to Layout → Add a Gadget → HTML/JavaScript and paste the code. Inside a post, switch the post editor to HTML view before pasting.

Shopify, Webflow and plain HTML sites

On Shopify, add a Custom Liquid section in the theme editor; on Webflow, use an Embed element; on a hand-coded site, paste the code in your HTML where the widget should appear. Nothing else needs to be installed.

Customize the widget

You can change a few settings directly in the address of the widget (the src="…" part of the first line):

  • Theme: theme=auto (follows the visitor’s light or dark mode), theme=light or theme=dark.
  • Language: lang=en for English or lang=fr for French.
  • Time zone: timezone=visitor shows times in each visitor’s local time. To use a fixed time zone, replace it with a name such as timezone=America/New_York or timezone=Europe/Paris.
  • Width: the widget fills the space available up to 860 px. To make it narrower, change max-width:860px in the style, for example to max-width:480px.

Height: you don’t need to set it. The small script in the second line resizes the widget to its content, including on phones where the cards stack vertically. If your platform removes scripts, the widget still works with the height given in the code (580 px): raise it to about 900 if it appears in a narrow column or on mobile.

How the moon data is calculated

Nothing is copied from a table that could go out of date. The position of the Moon and the Sun is computed in the visitor’s browser with Astronomy Engine, an open-source library of astronomical algorithms. From those positions the widget derives the phase angle, the illuminated fraction, the Moon’s sign in the tropical zodiac, and the exact times of the next New Moon, Full Moon and sign change.

The astronomical data is factual. The short sentence describing the “mood” of the Moon’s sign and phase is an astrological interpretation, offered for reflection and entertainment.

Light, private and free

  • No cookies, no ads, no tracking inside the widget.
  • Lightweight: about 70 KB in total, loaded only when the widget scrolls into view, so it does not slow down the rest of your page.
  • Free for personal and commercial websites. We only ask you to keep the small “Moon data by horoscope-us.com” link below the widget.

Frequently asked questions

Is the moon phase widget really free?

Yes. There is no account, no API key and no usage limit. Keeping the credit link is the only thing we ask.

Do I need to update it?

No. The widget recalculates the Moon every time it is displayed, and improvements we make reach your site automatically.

Will it work on phones?

Yes. On narrow screens the layout switches to a single column and the height adjusts automatically.

Can I put several widgets on the same page?

Yes, for example an English and a French version. Each one adjusts its own height. You only need the script line once per page, but keeping it twice does no harm.

Can I add it to my phone’s home screen?

This widget is made for websites. To check the Moon on your phone, bookmark our Moon Phase Today page or add it to your home screen from your browser’s share menu.

The widget shows the code as text. What went wrong?

The code was pasted into a normal text block. Delete it and paste it again into an HTML, Code or Embed block (see the instructions for your platform above). Also make sure your editor did not change the straight quotes " into curly ones: always use the Copy button on this page.

More moon and sky tools