My parents got divorced when I was 19 and had recently moved out for uni. The relationship which your parents have when you're growing up is the one which you perceive as normal, so for me I grew up thinking that a loveless marriage was a normal one. When they got divorced it shook my world up much more than it would have when I was a child- within a year of moving out of home, my 'home' was on the market and my family unit was no longer, so I was stuck in this horrible limbo where my uni halls didn't feel like proper home and then my proper home was gone.
If my parents had of divorced when I was a child, some stability would have remained as I would still have a family, it just would have had a new format. Children are so much more resilient and adaptable than adults, and there's a lot more support available for children going through parental divorces then there is for adults. On top of that, if my parents had have divorced when I was a child, they still would have been young enough to find other people. Whereas by the time they divorced they were both in their 50s and were so far stuck in their ways (married for 25 years) that they didn't know how to get back into dating and it was really tough for me watching my mum age, become ill and ultimately die on her own.
Their reason for not divorcing sooner was that me and my brother were their priority and they didn't want it to affect us with school or exams etc. But they ended up affecting us both on a much deeper level- you might think that your children don't notice there's anything wrong, but they pick up on a lot more than you give credit for. I spent years wondering why my mum and dad weren't like my friends, why they didn't sleep in the same bed or kiss eachother on the cheek when one came home from work or go out for meals without the kids. Not to mention the countless family holidays that they spent not talking to eachother and only talking to me and my brother. Their marriage was not spiteful or hateful or bitter, there was just no love their and no matter how hard they tried to hide it me and my brother were very aware of this.
You are absolutley doing the right thing for your children by splitting up. It may be difficult in the beginning, but life will carry on and your family will adapt and I can garuntee it will be much better in the long run. What matters now is how you handle the split- you need to do your best to handle it with no animosity or arguments over custody etc in front of the children, no whispering in their ears or making them pick sides. Remain civil and as friendly as possible, make Christmas/birthday/parents evening arrangements as easy as possible- if there are no problems like abuse or cheating etc and it's possible for you to remain friends and attend these things together, the divorce will be much easier for the whole family.
I'm sorry for how long this was- just wanted to give my take on things as 'staying together for the kids' is a subject I feel very strongly about. Good luck OP I know it is a difficult time but you will get through it 