Miguel is organizing textbooks on his bookshelf. He has a Spanish textbook, a math textbook, a physics textbook, and a writing textbook. How many different ways can he line the textbooks up on his bookshelf?

There are 4 textbooks, so there are 4 options for the first book. After placing the first book, there are 3 options for the second book, 2 options for the third book, and 1 option for the last book. Therefore, the number of different ways to line the textbooks up on the bookshelf is 4 x 3 x 2 x 1 = <<4*3*2*1=24>>24. Answer: \boxed{24}.