i have two cats but they seem to like the dog food better then the catfood. Should I just buy dogfood or is it unhealty for cats to eat dogfood. I know dogs shouldnt eat catfood but I wonder if it could work the other way around

Many cat foods are higher in protein than dog food. I wouldn't say it would hurt them, but some of cats' nutritional needs are not necessarily the same as dogs. So if they grab a bit no big deal, but I wouldn't feed it as a normal course of things.

Also, cats need a good amount of taurine in their diets. while some dog food mfgs have begun adding it, it has been a known necessary nutrient for cats for a long long time. Also too, ash is a problem for cats. Premium cat foods are specifically designed to have as little ash as possible. I do not know the ash contents in dog foods, if any, as it is not an issue.

Long story short, NO. It is NOT safe for cats to eat dog food on a long term basis, or for more than just an occasional snack if they happen to sneak it. Dog food is formulated for dogs, and as has already been mentioned, is not sufficient in several nutrients for cats.

cats also need to have fatty acids in their foods, something dog food is void of, (called arachidonic acid). also the vitamin A source for the canine and feline is different. Canines can convert the carotenes found in fruits and vegetables, due to their biochemical processes, into vitamin A, where felines cannot do this and must have their source already preformed in animal sources.
so yes, as stated, felines CAN eat dog food, however it is not recommended, as dog food does not meet all their nutritional needs, and ultimately, in the long run, it is more harmful than helpful.