You find out an item's rank in one of two ways. The first way works with most items, like all of the weapons and armor, because of how long their lists are. Starting from the first/weakest item you see, that's one, and you go up one number from there up until forty. (The shop for D2 lists one of each item in order of rank, so that's your reference.) For the lists that aren't so long, like the accessories (shoes, belts, glasses, orbs, muscles and symbols), their rank number often skips over numbers, rather than going up one rank every time. To find out what rank it is, see what the starting level for items are in the item world, and compare it against one of the long-list items. For instance, if you know that the rank six sword has a starting level of twenty-two, a level twenty-two orb must be a rank six item.
Do you put an item in the chest, or does one magically appear inside?