One of the most important defensive structures of any castle was it's network of moats. Beyond the moats that immediately surrounded the main castle compound and baileys, there were sometimes moats that surrounded the whole castle and those farther out to protect the castle town as well. In modern times, these moats have been mostly filled in but some live on as canals or through place names such as the the Sotobori Street in Tokyo which was built over the filled in Sotobori or "outer moat". There are many different moat types based on their shape and construction, but here are the most basic types.

Moat Shapes

There are two basic shapes of moats. A yagenbori is cut down to a point at the bottom so that the moat is shaped like a V. When moats get very wide however, it is not practical to dig deep enough to make a V shape, so the bottom is flat and extended as wide as necessary. These moats look like a box instead of a V and are literally called box moats, or hakobori. There are also variations on these 2 basic types with rounded bottoms (kenukibori) and one-sided yagenbori (katayagenbori).
Hakobori Yagenbori

Water Moats (水堀) • Dry moats (空堀)

Earlier castles were mostly mountaintop castles so they rarely had water filled moats. With the evolution of hilltop and flatland castles, water filled moats became more common. Water moats often connected with nearby wetlands, lakes, or the ocean to fill with water. During peaceful times, these waterways could also be used for commerce and transportation. Even in later day flatland castles with other water moats, the inner moats were sometimes dry moats. Dry moats are actually a stronger defense than water moats. With water moats, an attacker could hide in the water, swim across and even jump into the moat if pursued.
Water Moats
Edo Castle Nagoya Castle Matsumoto Castle Shirakawa Castle Takashima Castle
Dry Moats
Nagoya Castle Nagoya Castle Sakura Castle Mito Castle

Shojibori (障子堀) • Unebori (畝堀)

Shojibori is a unique moat structure employed to further slow down enemies attempting to cross a moat. A network of ridges is built in the bottom of the moat creating many additional little walls or barriers anyone trying to cross the moat would have to go over. If there is only a single row of ridges running across the moat these, are called unebori (ridge moats) rather than shojibori, which comes from the looks of Japanese paper screens which are called shoji.
Shojibori Unebori
Yamanaka Castle Yamanaka Castle Yamanaka Castle Yamanaka Castle

Horikiri (堀切)

Horikiri is a large cut in the land to either distinctly separate two baileys from each other or to cut across the spine of a mountain or hill to impede an attackers progress. The sides are usually cut steeply to prevent anyone from easily climbing up.
Mito Castle Uehara Castle Kanayama Castle

Earthen Embankments (土塁)

In a discussion about moats, we can't leave behind the earthen embankments that are also vital to the moat's function. This includes the sides of moats and the sides of baileys that may have been cut down or built up to separate two baileys from each other at different elevations. The dirt that is dug out to create a moat is often reused atop the inner edge of the moat to create an embankment that makes it higher and improves the line of sight and fire for defenders. The picture below from Mito Castle shows from the side how the earth was built up atop the moat for this type of structure.

Moat Walls

Most moats at castles these days where the walls are not lined with stone are covered in grass and shrubs to prevent erosion. Originally, these walls may or may not have been covered in grass. Simple walls of packed mud and clay would have been much more difficult for any attackers to climb but would have also been prone to erosion. In the case of plain mud walls, the angle of the wall was cut to about 45' to prevent too much erosion. They also mixed in clay to make the walls stronger and to make them slippery for anyone trying to climb up. In the case of grass covered walls the angles were sharper at 60' to make them more difficult to climb. You can see examples of both types in the moats pictures at the top of the page. Some moats also used a combination of stone lined walls, called ishigaki, with bare or grass covered walls. This was done to conserve stone compared to a completely stone lined wall, but was also stronger than those with no stone at all. There are 3 kinds of these combination walls. Hachimaki Ishigaki have the stone section at the top, Koshimaki Ishigaki is at the bottom and Hachimaki Koshimaki Ishigaki have a stone section at the top and bottom with an unlined section in the middle.
KoshimakiHachimakiKoshimaki Hachimaki
Hikone Castle Edo Castle Hikone Castle