Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Write Math Equations in WordPress

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to write math equations in WordPress?

Writing math equations in WordPress is a bit difficult as the default WordPress editor does not come with full support for mathematical equations.

In this article, we will show you how to easily write math equations in WordPress using 3 different methods.

Writing math equations in WordPress

Why Is Writing Math Equations in WordPress Difficult?

WordPress works dynamically by generating your website content and sending HTML output back to the users’ browsers to display.

Writing mathematical and scientific equations in WordPress is difficult due to the lack of support for the characters in HTML.

Currently, MathML and LaTeX are considered to be the standard for writing mathematical and scientific equations on the web.

Unfortunately, they are both less than ideal for beginners. They both require you to learn their syntax, which could get complicated for longer and more complex equations.

That being said, let’s look at how to write math equations on your WordPress blog.

We will start with an easy solution before showing how to use MathML or LaTeX in WordPress. You can use the quick links below to jump to the method you want to use:

Method 1: Writing Math Equations in WordPress Using Unicode Characters

This method is simpler and is recommended for users who don’t need to write math equations frequently. For this method, you will be using Unicode characters and inserting them directly in the post editor.

Unicode is the encoding standard to provide character encoding support for all languages. It is supported by all website builders, operating systems, and mobile devices.

Here is how to add mathematical characters in WordPress using Unicode.

1. Adding Unicode Mathematical Characters in Mac

On Mac computers, you can add mathematical operators and characters from the toolbar at the top. Simply click on Edit » Emoji & Symbols or press the Command + Control + Space keys on your keyboard.

Character Viewer

This will bring up the ‘Character Viewer’ app in a popup. From here, you can select the symbols and characters that you want to insert.

Simply double-click on a character to insert it in the WordPress post editor.

You can also format characters in the post editor using the subscript and superscript options in the paragraph toolbar.

Using subscript and superscript in WordPress paragraph block

2. Adding Unicode Mathematical Characters in Windows

Windows users can use a similar app to insert mathematical operators and special characters in the WordPress post editor.

Open the Character Map app by clicking Start » Windows Accessories » Character Map. This will bring up the commonly-used characters on the screen.

Character Map app in Windows 10

The Character Map app supports many different encodings, including Unicode. You can find math operators by selecting the Unicode Subrange under Group.

After locating a character, you need to click to select it and then copy it. Now, switch back to the WordPress content editor and paste the character.

Manually adding special characters and mathematical operators is a hassle, but it works if you’re only adding this once in a while.

However, if you regularly need to write mathematical equations on your site, then you will be better off learning to use either of the two methods described below.

Method 2: Writing Math Equations in WordPress Using LaTeX

LaTeX is a typesetting standard explicitly designed for writing technical and scientific documentation.

It is widely used in academic circles and is considered the de facto standard for writing equations and other scientific documents.

The official LaTeX website has detailed documentation and links to tutorials and guides that will help you learn how to use it.

We will focus on how to bring LaTeX typesetting to your WordPress website.

First, you need to install and activate the MathJax-LaTeX plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to edit the post or page where you want to insert a math equation. On the post edit screen, click the add new block button (+) and insert the Shortcode block into your content.

Shortcode block

Inside the Shortcode block, you need to add the shortcode in the following format:

[latex]your LaTeX code here[/latex]

Add your shortcoe with the latex code

You can now save your post and preview it to see your math equation with formatting.

This is how it looked on our demo WordPress website.

A math equation displayed in WordPress using LaTeX

An easier way to generate the code that you need is by using an offline LaTeX app for your operating system.

Alternatively, you can also use a web-based LaTeX environment like Overleaf.


You can then copy and paste your equations into the Shortcode block in WordPress.

Method 3: Writing Math Equations in WordPress Using MathML

MathML is a markup language designed to easily publish mathematical equations on the web. It uses a semantic XML markup similar to HTML.

WordPress doesn’t support MathML out of the box, and if you added the MathML code in the post editor, it will not render correctly.

Luckily, there is a plugin that solves that problem.

Simply install and activate the MathML Block plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, simply edit the post or page where you want to add the math equation. On the post edit screen, click on the add new block button (+) and add the Custom HTML block to your content.

Adding custom HTML block in WordPress

You can now paste your MathML code inside the custom HTML block.

It should look something like this.

Adding MathML code in WordPress

After that, you can save your post or page.

When you view it in a new tab, you will see MathML beautifully transformed on your website.

MathML preview

MathML Block uses the MathJax JavaScript engine to convert your markup into readable math equations. It also supports LaTeX commands.

To add your LaTeX code, simply add the MathML block to your content editor.

Adding MathML block

In the MathML block’s text area, you can paste your LaTeX code like this:

\[ your equation goes here\]

You can now save and preview your post to see it displayed in your blog post or page.

LaTeX in MathML Block

We hope this article helped you learn how to add math equations in WordPress. You may also want to see our expert picks for the best WordPress calculator plugins and our guide on how to write a great blog post.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Agu Sunday says

    It was really helpful. it has solved the problem of many months of watching a lot of video without success. Thanks you so much

  3. Ira Grossman says

    I read on a Mircrossoft page that the shortest way to get to character map is to type “map” in the search bar and then select it from the list. Works for me, but with all things Windows you should check it out.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.