
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
mathml2omml
Advanced tools
Convert MathML to the OOML format used in DOCX files without XSLT.
You can use it like this:
import {mml2omml} from "mathml2omml"
const mml = '<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>
<mn>2</mn>
<mo>+</mo>
<mn>2</mn>
<mo>=</mo>
<mn>4</mn>
</mrow>
</semantics>
</math>'
const omml = mml2omml(mml)
console.log(omml)
> <m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
> <m:r>
> <m:t xml:space="preserve">2+2=4</m:t>
> </m:r>
> </m:oMath>
This library includes TypeScript definitions:
import { mml2omml } from "mathml2omml";
// Simple usage
const omml = mml2omml(mathmlString);
// With options
const omml = mml2omml(mathmlString, { disableDecode: true });
// Using the class directly
import { MML2OMML } from "mathml2omml";
const converter = new MML2OMML(mathmlString);
converter.run();
const result = converter.getResult();
LGPL v.3.0 or later.
The xml parser/stringifier in the parse-stringify-folder is based upon html-parse-stringify (MIT).
License of test files depends on source of files.
Some test fixtures fall under other licenses/copyrights. See the LICENSE and copyright.txt files in the different test fixture folders.
Remaining test fixtures fall under the same license and copyright as the source code.
FAQs
a MathML to OMML converter
The npm package mathml2omml receives a total of 8,813 weekly downloads. As such, mathml2omml popularity was classified as popular.
We found that mathml2omml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.