I would like to know where this "FullForm" in Mathematica will be useful. Kindly provide some examples. I just started learning Mathematica. If my question is wrong or not correct. I'm sorry about that.

  • 7
    $\begingroup$ Whenever a student asks me a question about Mathematica where I don't know the answer, I apply FullForm. Either this helps show what happened, or else it gives me time to think of something else. $\endgroup$
    – bill s
    Sep 9, 2019 at 19:05

1 Answer 1


Perhaps there are other uses, but I've primarily used FullForm to "see" what Mathematica "sees". This can be useful when you are trying to do replacements on something like $\frac{x}{\sqrt{5}}+y^2+1/z$. What Mathematica actually sees is

Plus[Times[Power[5, Rational[-1, 2]], x], Power[y, 2], Power[z, -1]]

You might want to do a replacement such as:

Plus[Times[Power[5, Rational[-1, 2]], x], Power[y, 2], Power[z, -1]]/.Rational[-1, 2] -> 6
(* 15625x + y^2 + 1/z *)

Replacements generally match to the FullForm and in some cases replacements will fail because Mathematica interprets it differently than you do. For example:

x/Sqrt[5] + y^2 + 1/z /. Sqrt[5] -> 6

This fails to give the expected result, because there is no Sqrt in the function by the time you go to run it.

Another place I've used FullForm is for inspecting the code for graphics and plots when they are misbehaving. There's a lot of stuff that happens behind the scenes when generating a plot, and so sometimes it's beneficial to see what the actual result of all that code is. For example, I can see what tick marks were chosen, and I can even replace them with my own tick marks after the fact if I desire. However, I would usually use InputForm for this as I find it slightly more readable.

  • 4
    $\begingroup$ For inspecting graphics my shortInputForm function is much more handy than InputForm. $\endgroup$ Sep 9, 2019 at 17:19
  • $\begingroup$ And InputForm can be achieved by Ctrl+Shift+I. (There exist cases that InputForm is missleading of course e.g. Sqrt[2] // InputForm.) $\endgroup$
    – xzczd
    Sep 9, 2019 at 17:38
  • 5
    $\begingroup$ FullForm is tremendously useful for understanding precedence in pattern matching as well. That's where I most rely on it. $\endgroup$
    – ktm
    Sep 9, 2019 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.