The Sagulator helps you design shelves by calculating shelf sag (deflection) given type of shelf material, shelf load, load distribution, dimensions, and method of attachment. You can also specify an edging strip to further stiffen the shelf.
https://woodbin.com/calcs/sagulator/