returns True if quantity1 and quantity2 have compatible units, and False otherwise.



open allclose all

Basic Examples  (3)

Test whether two Quantity objects are compatible:

Test whether two units are compatible:

Test compatibility of a sequence of quantities and units:

Scope  (6)

Test compatibility of Quantity objects:

Test compatibility of unit expressions:

Test compatibility of the elements of lists:

Test whether QuantityArray objects have compatible units:

Use MixedUnit specifications:

Use DatedUnit specifications:

Properties & Relations  (6)

CompatibleUnitQ returns True when its elements have the same UnitDimensions:

An IndependentUnit object is only compatible with itself:

Known units are not compatible with IndependentUnit objects of the same name:

Numeric expressions are treated as dimensionless quantities:

CompatibleUnitQ will automatically attempt to interpret an unknown unit string:

CompatibleUnitQ with one argument is similar to KnownUnitQ:

CompatibleUnitQ accepts numeric expressions:

CompatibleUnitQ attempts to interpret unknown unit strings:

If elements other than quantities and units are present, CompatibleUnitQ returns False:

Possible Issues  (1)

Temperatures and temperature differences are compatible, but may not always be freely converted to one another:

Wolfram Research (2012), CompatibleUnitQ, Wolfram Language function, (updated 2022).


Wolfram Research (2012), CompatibleUnitQ, Wolfram Language function, (updated 2022).


Wolfram Language. 2012. "CompatibleUnitQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022.


Wolfram Language. (2012). CompatibleUnitQ. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_compatibleunitq, author="Wolfram Research", title="{CompatibleUnitQ}", year="2022", howpublished="\url{}", note=[Accessed: 17-July-2024 ]}


@online{reference.wolfram_2024_compatibleunitq, organization={Wolfram Research}, title={CompatibleUnitQ}, year={2022}, url={}, note=[Accessed: 17-July-2024 ]}