Preheat oven to 400 degrees. Line a large baking sheet with parchment paper. Set aside
For sandwich size buns lightly spray 5 wide mouthed mason jar lids and place them upside down onto the prepared baking sheet
For hamburger size buns create foil rings about 4 inches in diameter (see my post on how to make foil holders the link is in the notes) Lightly spray the foil rings and place on the prepared baking sheet
Preheat the oil in a large skillet over medium high heat for about 5 minutes or until the oil is warm
Add the chopped onion and cook over medium high heat for about 5 minutes or until the onion is soft and lightly browned. Set aside
In a large mixer bowl whisk together coconut flour, salt, baking powder, onion powder, and xanthan gum until fully combined and no lumps are in the flour
Add the eggs and beat on low for 10 seconds or until the dry ingredients are moist. Increase speed to medium and beat for 30 seconds or until fully combined
Scrape down the sides of the bowl and push all ingredients to the center of the bowl. Add melted butter and beat on medium for about 30 seconds or until fully combined and smooth
Scrape down the sides of the bowl and push all ingredients to the center of the bowl. Use a whisk and whisk by hand a few seconds just to make sure there are no lumps in the batter
Gradually fold in the mozzarella cheese in small portions until it is fully distributed throughout the batter. If desired you can fold in some of the cooked onion for extra chunks in the buns
Scoop dough out 1/3 cup at a time for sandwich buns and 1/2 cup at a time for burger buns. Place the scoops into the center of each mason jar lid or foil ring
Use a small spatula or butter knife and shape the scoops into a circular smooth shape. These do not spread very much so make sure they are shape as much like a hamburger or sandwich bun as possible.
Sprinkle the top of each bun with 1-2 TBS of the cooked onion. Bake at 400 degrees for 15-20 minutes or until golden.(for me the sandwich size buns took 17 minutes and the burger buns took 21 minutes)
Remove from oven. Buns will still be soft but should be turning golden around the edges. Let sit on the pan for 15 minutes so the ingredients can set into place.
Transfer to a wire rack and allow to cool completely before cutting.
When ready to use cut the buns in half to create a top and bottom bun. For an extra fluffy sandwich or burger use one whole bun for a top bun and one whole bun for the bottom bun