I use a lot of algorithm-style stocking processes in order to quiet the ghosts in my brain, and I'd thought I'd take the time to set out the basic process I've been using for making fantasy sandboxes. The sandbox described below hypothetically should provide 6+ months of play and take 5e characters* from levels 1-10.
Some caveats:
1) This represents a synthesis of methods I've used previously. I have not used this precise method as I am about to lay it out, but the version present here represents the previous methods with the changes I would make based on how I felt about those results.
2) For 5e it assumes that you are stocking things using the level bands in Xanathar's Guide's random monster tables (1-4, 5-10, etc.),
3) It also assumes encounters per level based on this guy's post taken with the comments there and my own experiences with 5e. I cannot replicate The exact numbers for that here because it is a belly-feel sort of thing.
4) I am going to assume that you have a kind of genre of fantasy you already want to emulate and so don't necessarily need help coming up with the material culture for the area or the threats the adventurers will face. This is about the kinds of things you'll need not the specific things you'll pick.
5) Sometimes the most important answer a player can give in a sandbox is "no" or "not that one." You should have more content than you expect the players to see because it is important that they be able to turn hooks down.
6) Since OSD&D leveling rates are primarily due to treasure, if you want to use the same rates just make sure the dungeons I talk about contain enough treasure to do that.
This is kind of a cheat because Huth made it for me
The first thing you will need is a map. I use hex maps that are roughly 25x15 hexes at 6 miles a hex. For most campaigns this size is probably fine, but if you want a higher degree of wilderness exploration in your game then 4 of these laid out in a 50x30 grid should be used. If you're using a section of a pre-made setting then simply cut out a section of geography that would fit inside those grids. If not, you can use something like the Welsh Piper's system or just draw it freehand if you feel like you're good at that sort of stuff.
For each 25x15 grid you have, place between 4 and 8 settlements - including villages, forts, castles, towns, and cities. Note that these are only the settlements where the PCs are expected to interact with mostly peacefully or civilized factions that the PCs may be "at war" with. It does not include large groups of monsters or bandits. If you're worried that this is too few settlements, then just use the Judges Guild-style hamlet system. Personally, I worry less about this sort of thing now in part because I want places the PCs will remember.
Place cities, towns, and castles in areas that would seem to be of strategic import - bays/harbors, mountain passes, hills overlooking large areas of flatland, where rivers meet, etc. Forts and villages should be placed so that each is about a day away from another settlement and that the major cities and castles could be traveled to without having to go a day resting in the wilderness. The main exception to this type of placement is if you assume the settlements are at war, in which case there should be some days worth of no man's land between them.
For each of these settlements, write a short paragraph about it including who rules it and any other NPCs the players could interact with, and any weird things about it. I usually also include the population, the permanent garrison (if any), and the potential muster. If you don't plan on having a lot of warfare you don't necessarily need that.
This is about the right size
Next you'll need dungeons. I am assuming each dungeon has ~20-30 rooms and about 1/3 of those contain combat encounters. I have a whole notebook full of maps like the one above that I've copied or made over the past few years. Some of them have a lot more rooms than that, some have a lot fewer, but on the whole if I use ones from that notebook it'll average out. If you don't have that you can find a bunch online or just draw them yourself. If my belly-feel is right, you need about two of these to level from 1-4 in 5e. In-keeping with the idea that you want more material than you'll use, have three dungeons near the starting town for the PCs that are stocked to be low level (1-4). You'll want to make sure these have backgrounds that go with your setting, but that's beyond the scope of this post. You'll want to have these stocked for the first session.
For the midlevel dungeons (i.e. the rest of the campaign as outlined here). You'll want 12-15 dungeons of similar size but with more variables in terms of encounter difficulty. You don't need to stock these yet. For right now right a short paragraph saying what they're the ruins of and maybe something else that makes them a neat dungeon so you know what they'll be when you need them later. These dungeons should be scattered about the rest of the map you have as you see fit. Note that it's 12-15 dungeons regardless of whether you're using a 25x15 grid or a 50x30 grid.
Something about like this
Next you'll need some hex contents. I'm not a 1 hex = 1 encounter sort of guy, having come to hex-crawling through the 3e Wilderlands products. I've arrived at about 40 per 25x15 grid to start off with as a good number. That should be one encounter for every column and one for every row on average (though you don't have to place them that strictly). If you're using a 50x30 grid you'll need 160, but you can probably get by by just populating the 40 that go in the quadrant where your players will start in and stock the rest as they explore what you've already made.
To stock hexes I use the Ruins & Relics tables in the Ready Ref sheets or the 3e Wilderlands book (they're the same tables). If you don't have access to those, there may be others online, but I'm too lazy to find them now. The Ruins & Relics tables generate a type of thing you found, its state of decay, and the creatures guarding it. It's possible to monkey with these tables to better fit your setting, but that can be kind of an undertaking so I recommend just editing the guardians section to reflect what you want in the setting and then disregarding rolls that seem weird (like flying machine wrecks if you don't want that sort of thing).
Before you place them on the map, make sure you've named your geography if you haven't already. If you notice you have a lot of a certain type of encounter (say things with snakes) you can place them semi-near each other in the same region and name it after that sort of encounter. In Yavana this led to the Serpentine Jungle which I more often than not ended up calling the Jungle of Serpents.
Next I do random encounter tables for each geographical region. The ones containing the starter dungeons I set to levels 1-4, everything else is 5-10. I use a 1d6+1d4 table that produces numbers 2-10 and a flat curve. This allows me enough range to have a variety of encounters but a limited enough range for the regions to feel different AND that I don't feel like I have to add things that don't fit just because I have some missing spaces.
Below is an example from yavan; however, it should be noted that this was not designed with a specific level range in mind.
Mangrove Swamp
2 - Plesiosaur
3 - Raptors
4 - Camarasaurus
5 - Iguana-People
6 - Trachodons
7 - Tiger
8 - Bucaneers
9 - Giant Spider
10 - Giant Crocodile
If you want to bake how many monsters show up into the tables (or determine them for a Ruins & Relics result), use the dice ranges for a similarly CRed creature from the Xanathar's tables.
Finally, before you can run you'll need some hooks, otherwise the PCs won't know what to do or where to go. I use the Tome of Adventure Design to generate hooks. There are other methods available online, or you can just make them up as you go. Tie any hooks you generate to content you've already created if possible, and add elements not already created when necessary.
For the first session you'll want to make sure that you have three hooks, so there are some choices, and that at least two of them lead to low level dungeons you've made. All three can if you like, but it's also perhaps useful to have one that ties to some overland adventure for variety's sake.
It used to be that I would then add two-three hooks a week each week thereafter, tying them either to wilderness locations I'd already placed or dungeons I'd just stocked; however, I found that with my home group this quickly meant there were too many hooks floating around to keep straight. It may be a better idea to only introduce new hooks when you think they're about to finish something up and even then only if they don't have a big to do list waiting thereafter.
Once you've done all of that you might consider some of the extra steps Rob Conley uses, but I tend to let "plots" develop organically using the hooks and maybe the Oriental Adventures event tables rather than coming up with them ahead of time. Regardless, you should have enough material for a long period of gaming.