URDF to MJCF Converter — convert URDF to MuJoCo XML online
Free online URDF to MJCF converter: rebuilds the kinematic tree, maps joints and limits, converts full extents to MuJoCo half-extents, and preserves full inertia tensors. Runs in your browser — nothing is uploaded.
The conversions that break naive scripts (and how this tool handles them)
| Difference | URDF | MJCF (MuJoCo) | This tool |
|---|---|---|---|
| Box size | Full extents | Half-extents | Divides by 2 |
| Cylinder length | Full length | Half-length | Divides by 2 |
| Angle units | Radians | Degrees by default | Emits <compiler angle="radian"> |
| Structure | Flat link/joint list | Nested body tree | Rebuilds the tree from joints |
| Joint placement | Between parent/child | Inside the child body | Joint origin becomes body frame |
| Fixed joints | Explicit joint | Jointless welded body | Body without joint (compiler fuses) |
| Off-diagonal inertia | ixy/ixz/iyz | Often dropped by scripts | Preserved via fullinertia |
| Mimic joints | <mimic> | No direct equivalent | Emitted as <equality> constraint |
| Visual vs collision | Separate elements | Geom groups/contype | Visual: group 2, no contact; collision: group 3 |
Output is verified against MuJoCo 3.10: converted models compile with MjModel.from_xml_string and simulate without modification (mesh-free models; mesh models need their asset files placed alongside).
Notes on meshes and actuators
Mesh geometries are emitted as <asset> entries referencing the original filenames — place the mesh files next to the MJCF and fix any package:// paths. MuJoCo does not read COLLADA (.dae); convert those meshes to STL or OBJ. A starter <actuator> block with one motor per actuated joint (ctrlrange from URDF effort limits) is appended so the model is immediately usable for control experiments and RL.
Check your source file first: run it through the URDF validator — zero-mass links and missing joint limits cause MuJoCo compile errors. Batch conversion or CAD→simulation pipelines: Pro tools →