Yes, you can eat eggs that float, but they may not be as fresh as eggs that sink. If you’re unsure about an egg’s freshness, you can crack it open and smell it before cooking. If it smells bad, it’s best to throw it out.
If an egg floats that means there is a large air cell inside. This means it’s older, and may not be as fresh as an egg that sinks. However, it doesn’t necessarily mean the egg is bad and you can still cook with it if you want. Just know that it might not taste as good as a fresher egg.
If you’re uncertain about an egg’s freshness, the best way to tell is to crack it open and give it a sniff. If it smells bad, then it’s probably not good to eat. But if it smells fine, then you can go ahead and cook with it. Keep in mind that an older egg likely won’t taste as good as a fresher one, though.