Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to turn a sum like this

sum =a-b+c+d

Into a List like this:


How can I achieve this?

share|improve this question
up vote 12 down vote accepted
List @@ sum
(* {a, -b, c, d} *)

From the docs on Apply (@@):

f@@expr replaces the head of expr by f.

So List@@sum replaces Head[sum] (that is, Plus) with List.

share|improve this answer

Try :

a - b + c + d /. Plus -> List

You can have a look at a - b + c + d //FullForm to see why this works.

share|improve this answer
Good one. And maybe sum[[0]] = List; sum – user 106 Oct 22 '12 at 19:32
@TomD that is the one I like to use :) – Mike Honeychurch Oct 22 '12 at 22:24

Still another route:

Last[CoefficientArrays[#]] Variables[#] &[a - b + c + d]
   {a, -b, c, d}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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