When I store it in the refrigerator, my simple syrup always seems to crystallize. How can I prevent this? How long should I expect simple syrup to keep?
There are a couple of things you can do to prevent sugar crystallising. You can add some glucose syrup, or you can 'invert' the sugar by adding some acid, namely cream of tartar. Both should be readily available, online if not at your supermarket. Cream of tartar is also useful when making meringue.
When my honey crystallizes, I put it in an electric oven set to 50 degrees C for a couple of hours. Perhaps this trick would work with syrup as well since their composition is similar. Also, make sure that there are no crystals when you put it in the refrigerator, they act as seeds on which more crystals grow.
I make a lot of syrup because I love pancakes and waffles. There are a couple of things I do which I have found keep my syrup from crystallizing (this is based on personal experience and not any kind of scientific proof).
1) I only use about 3/4 the amount of sugar. My recipe calls for 2 cups but I only use 1 1/2 cups.
2) I don't boil the sugar. I boil the water, remove it from the heat, and immediately stir in the sugar. just make sure the sugar dissolves completely.
This does make the syrup thinner, but we prefer it that way.
A scrupulously clean saucepan is important. It's possible that banging or scraping the spoon along the insides of the saucepan "seeds" the crystallization process. Also, "A seed crystal is a surface that sucrose molecules (that's the sugar) can begin to attach themselves to—it could be a few sucrose molecules stuck together, a piece of dust, or even a little air bubble." So, stirring well but not crazily is advised.
If you're adding sugar and water together, don't bring it up to a boil. Gently simmer it for a longer period of time until the sugar is completely dissolved. Also, the higher the sugar ratio, the higher the likelihood of crystals forming. From my experience, bringing it to a boil is what causes the crystallization, for whatever reason.